Package org.apache.commons.httpclient

Classes and interfaces supporting the client side of the HTTP protocol.

The HttpClient component supports the client-side of RFC 1945 (HTTP/1.0) and RFC 2616 (HTTP/1.1), several related specifications (RFC 2109 (Cookies), RFC 2617 (HTTP Authentication), etc.), and provides a framework by which new request types (methods) or HTTP extensions can can be easily created or supported.

The basis for the abstraction is provided by three types:

    HttpConnection
    represents a network connection to some HTTP host.
    HttpMethod
    represents a request to be made over some HttpConnection and contains the server's response.
    HttpState
    contains the HTTP attributes that may persist from request to request, such as cookies and authentication credentials.

and several simple bean-style classes:

HttpClient provides a simple "user-agent" implementation that will suffice for many applications, but whose use is not required.

HttpClient also provides several utilities that may be useful when extending the framework:

    HttpMethodBase
    an abstract base implementation of HttpMethod, which may be extended to create new method types or to support additional protocol HTTP features.
    HttpStatus
    an enumeration of HttpStatus codes.
    ChunkedOutputStream
    an OutputStream wrapper supporting the "chunked" transfer encoding.
    ChunkedInputStream
    an InputStream wrapper supporting the "chunked" transfer encoding.
    URIUtil
    provides utilities for encoding and decoding URI's in the %HH format.

HttpClient Configuration with Java Properties

Java properties can be set at run time with the -Dname=value command line arguments to the application that uses HttpClient. These properties can also be set programaticly by calling System.getProperties().setProperty(name, value). This is the list of properties that HttpClient recognizes:
Name Type Effect
httpclient.useragent String Sets the User-Agent string to be sent on every HTTP request.
httpclient.authentication.preemptive boolean Sends authorization credentials without requiring explicit requests from the web server
  • Interface Summary 
    Interface Description
    Credentials Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpConnectionManager Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpMethod Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpMethodRetryHandler Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    MethodRetryHandler Deprecated.
  • Class Summary 
    Class Description
    ChunkedInputStream Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ChunkedOutputStream Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ConnectMethod Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ContentLengthInputStream Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    Cookie Deprecated.
    DefaultHttpMethodRetryHandler Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    DefaultMethodRetryHandler Deprecated.
    Header Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HeaderElement Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HeaderGroup Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HostConfiguration Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpClient Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpConnection Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpConstants Deprecated.
    use EncodingUtil class
    HttpHost Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpMethodBase Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpParser Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpState Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpStatus Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpsURL Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpURL Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpVersion Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    MultiThreadedHttpConnectionManager Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    NameValuePair Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    NTCredentials Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ProxyClient Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ProxyClient.ConnectResponse
    Contains the method used to execute the connect along with the created socket.
    ProxyHost Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    SimpleHttpConnectionManager Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    StatusLine Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    URI Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    URI.LocaleToCharsetMap
    A mapping to determine the (somewhat arbitrarily) preferred charset for a given locale.
    UsernamePasswordCredentials Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
  • Exception Summary 
    Exception Description
    CircularRedirectException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ConnectionPoolTimeoutException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ConnectTimeoutException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpContentTooLargeException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    HttpRecoverableException Deprecated.
    no longer used
    InvalidRedirectLocationException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    NoHttpResponseException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    ProtocolException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    RedirectException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
    URI.DefaultCharsetChanged
    The charset-changed normal operation to represent to be required to alert to user the fact the default charset is changed.
    URIException Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
  • Error Summary 
    Error Description
    HttpClientError Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.