HttpClient
, which acts as a central configuration object (for example
for idle timeouts
, max connections per domain
, etc.) and as a factory for Request
objects.See: Description
Interface | Description |
---|---|
ContentDecoder |
ContentDecoder decodes content bytes of a response. |
ProtocolHandler | |
Schedulable |
Class | Description |
---|---|
AuthenticationProtocolHandler | |
ContentDecoder.Factory |
Factory for
ContentDecoder s; subclasses must implement ContentDecoder.Factory.newContentDecoder() . |
ContinueProtocolHandler | |
GZIPContentDecoder |
ContentDecoder for the "gzip" encoding. |
GZIPContentDecoder.Factory |
Specialized
ContentDecoder.Factory for the "gzip" encoding. |
HttpAuthenticationStore | |
HttpClient |
HttpClient provides an efficient, asynchronous, non-blocking implementation
to perform HTTP requests to a server through a simple API that offers also blocking semantic. |
HttpConnection | |
HttpContentResponse | |
HttpConversation | |
HttpCookieParser | |
HttpCookieStore | |
HttpDestination | |
HttpExchange | |
HttpReceiver | |
HttpRequest | |
HttpRequestException | |
HttpResponse | |
HttpSender | |
RedirectProtocolHandler | |
RequestNotifier | |
ResponseNotifier |
Exception | Description |
---|---|
HttpResponseException |
HttpClient
, which acts as a central configuration object (for example
for idle timeouts
, max connections per domain
, etc.) and as a factory for Request
objects.
The HTTP protocol is based on the request/response paradigm, a unit that in this implementation is called
exchange and is represented by HttpExchange
.
An initial request may trigger a sequence of exchanges with one or more servers, called a conversation
and represented by HttpConversation
. A typical example of a conversation is a redirect, where
upon a request for a resource URI, the server replies with a redirect (for example with the 303 status code)
to another URI. This conversation is made of a first exchange made of the original request and its 303 response,
and of a second exchange made of the request for the new URI and its 200 response.
HttpClient
holds a number of destinations
, which in turn hold a number of
pooled connections
.
When a request is sent, its exchange is associated to a connection, either taken from an idle queue or created
anew, and when both the request and response are completed, the exchange is disassociated from the connection.
A conversation may span multiple connections on different destinations, and therefore are maintained at the
HttpClient
level.
Applications may decide to send the request and wait for the response in a blocking way, using
Request#send()
.
Alternatively, application may ask to be notified of response events asynchronously, using
Request#send(Response.Listener)
.Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.