com.atlassian.confluence.it.web
Class HttpRequest

java.lang.Object
  extended by com.atlassian.confluence.it.web.HttpRequest

public class HttpRequest
extends java.lang.Object

Provides authenticated raw HTTP access to Confluence URLs for testing.


Method Summary
static void execute(User user, org.apache.commons.httpclient.HttpMethod method)
          Executes the provided request.
static HttpRequest get(User user, java.lang.String url)
          Executes a GET on the provided URL.
 java.lang.String getResponseBody()
           
 java.lang.String getResponseHeader(java.lang.String headerName)
           
 int getStatusCode()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static void execute(User user,
                           org.apache.commons.httpclient.HttpMethod method)
                    throws java.io.IOException
Executes the provided request. The method parameter will then contain information about the response.

Throws:
java.io.IOException - as documented by HttpClient.executeMethod(HttpMethod)

get

public static HttpRequest get(User user,
                              java.lang.String url)
Executes a GET on the provided URL. The returned HttpRequest object can be used to query information about the result.

Throws:
java.lang.RuntimeException - if any problem occurs with the request, where the cause is any exception thrown by HttpClient.executeMethod(HttpMethod)

getStatusCode

public int getStatusCode()

getResponseHeader

public java.lang.String getResponseHeader(java.lang.String headerName)

getResponseBody

public java.lang.String getResponseBody()
                                 throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2003-2013 Atlassian. All Rights Reserved.