Class HttpUtils

java.lang.Object
org.jboss.jbossts.txbridge.utils.HttpUtils

public class HttpUtils extends Object
Utilities for client http requests
Version:
$Revision: 82338 $
Author:
Scott.Stark@jboss.org
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.commons.httpclient.HttpMethodBase
    Perform a get on the indicated URL and assert an HTTP_OK response code
    static org.apache.commons.httpclient.HttpMethodBase
    accessURL(URL url, String realm, int expectedHttpCode)
    Perform a get on the indicated URL and assert that the response code matches the expectedHttpCode argument.
    static org.apache.commons.httpclient.HttpMethodBase
    accessURL(URL url, String realm, int expectedHttpCode, int type)
     
    static org.apache.commons.httpclient.HttpMethodBase
    accessURL(URL url, String realm, int expectedHttpCode, org.apache.commons.httpclient.Header[] hdrs)
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • HttpUtils

      public HttpUtils()
  • Method Details

    • accessURL

      public static org.apache.commons.httpclient.HttpMethodBase accessURL(URL url) throws Exception
      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

      public static org.apache.commons.httpclient.HttpMethodBase createMethod(URL url, int type)