Package org.jboss.jbossts.txbridge.utils
Class HttpUtils
java.lang.Object
org.jboss.jbossts.txbridge.utils.HttpUtils
Utilities for client http requests
- Version:
- $Revision: 82338 $
- Author:
- Scott.Stark@jboss.org
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.httpclient.HttpMethodBase
Perform a get on the indicated URL and assert an HTTP_OK response codestatic org.apache.commons.httpclient.HttpMethodBase
Perform a get on the indicated URL and assert that the response code matches the expectedHttpCode argument.static org.apache.commons.httpclient.HttpMethodBase
static org.apache.commons.httpclient.HttpMethodBase
static org.apache.commons.httpclient.HttpMethodBase
accessURL
(URL url, String realm, int expectedHttpCode, org.apache.commons.httpclient.Header[] hdrs, int type) static org.apache.commons.httpclient.HttpMethodBase
createMethod
(URL url, int type)
-
Field Details
-
GET
public static final int GET- See Also:
-
POST
public static final int POST- See Also:
-
HEAD
public static final int HEAD- See Also:
-
OPTIONS
public static final int OPTIONS- See Also:
-
PUT
public static final int PUT- See Also:
-
DELETE
public static final int DELETE- See Also:
-
TRACE
public static final int TRACE- See Also:
-
-
Constructor Details
-
HttpUtils
public HttpUtils()
-
-
Method Details
-
accessURL
Perform a get on the indicated URL and assert an HTTP_OK response code- Parameters:
url
-- Returns:
- The commons HttpClient used to perform the get
- Throws:
Exception
- on any failure
-
accessURL
public static org.apache.commons.httpclient.HttpMethodBase accessURL(URL url, String realm, int expectedHttpCode) throws Exception Perform a get on the indicated URL and assert that the response code matches the expectedHttpCode argument.- Parameters:
url
-expectedHttpCode
- the http response code expected- Returns:
- The commons HttpClient used to perform the get
- Throws:
Exception
- on any failure
-
accessURL
public static org.apache.commons.httpclient.HttpMethodBase accessURL(URL url, String realm, int expectedHttpCode, int type) throws Exception - Throws:
Exception
-
accessURL
public static org.apache.commons.httpclient.HttpMethodBase accessURL(URL url, String realm, int expectedHttpCode, org.apache.commons.httpclient.Header[] hdrs) throws Exception - Throws:
Exception
-
accessURL
public static org.apache.commons.httpclient.HttpMethodBase accessURL(URL url, String realm, int expectedHttpCode, org.apache.commons.httpclient.Header[] hdrs, int type) throws Exception - Throws:
Exception
-
createMethod
-