The core class is HttpClient
, which acts as a central configuration object (for example
for idle timeouts
, max connections per destination
, 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.
Conversations 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(org.eclipse.jetty.client.api.Response.CompleteListener)
.
Interface | Description |
---|---|
AsyncContentProvider |
A
ContentProvider that notifies listeners that content is available. |
AsyncContentProvider.Listener |
A listener that is notified of content availability
|
ConnectionPool | |
ContentDecoder |
ContentDecoder decodes content bytes of a response. |
HttpClientTransport |
HttpClientTransport represents what transport implementations should provide
in order to plug-in a different transport for HttpClient . |
ProtocolHandler |
A protocol handler performs HTTP protocol operations on
behalf of the application, typically like a browser would.
|
Synchronizable |
Implementations of this interface expose a lock object
via
Synchronizable.getLock() so that callers can synchronize
externally on that lock: |
Class | Description |
---|---|
AbstractConnectionPool | |
AbstractHttpClientTransport | |
AuthenticationProtocolHandler | |
ContentDecoder.Factory |
Factory for
ContentDecoder s; subclasses must implement ContentDecoder.Factory.newContentDecoder() . |
ContinueProtocolHandler |
A protocol handler that handles the 100 response code.
|
DuplexConnectionPool | |
GZIPContentDecoder |
ContentDecoder for the "gzip" encoding. |
GZIPContentDecoder.Factory |
Specialized
ContentDecoder.Factory for the "gzip" encoding. |
HttpAuthenticationStore | |
HttpChannel | |
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 | |
HttpContent |
HttpContent is a stateful, linear representation of the request content provided
by a ContentProvider that can be traversed one-way to obtain content buffers to
send to a HTTP server. |
HttpContentResponse | |
HttpConversation | |
HttpDestination | |
HttpExchange | |
HttpProxy | |
HttpReceiver |
HttpReceiver provides the abstract code to implement the various steps of the receive of HTTP responses. |
HttpRedirector |
Utility class that handles HTTP redirects.
|
HttpRequest | |
HttpResponse | |
HttpSender |
HttpSender abstracts the algorithm to send HTTP requests, so that subclasses only implement
the transport-specific code to send requests over the wire, implementing
HttpSender.sendHeaders(HttpExchange, HttpContent, Callback) and
HttpSender.sendContent(HttpExchange, HttpContent, Callback) . |
LeakTrackingConnectionPool | |
MultiplexConnectionPool | |
MultiplexHttpDestination | |
Origin | |
Origin.Address | |
PoolingHttpDestination | |
ProtocolHandlers |
A container for
ProtocolHandler s accessible from HttpClient.getProtocolHandlers() . |
ProxyAuthenticationProtocolHandler |
A protocol handler that handles the 401 response code
in association with the
Proxy-Authenticate header. |
ProxyConfiguration |
The configuration of the forward proxy to use with
HttpClient . |
ProxyConfiguration.Proxy | |
RedirectProtocolHandler |
A protocol handler that handles redirect status codes 301, 302, 303, 307 and 308.
|
RequestNotifier | |
ResponseNotifier | |
SendFailure | |
Socks4Proxy | |
Socks4Proxy.Socks4ProxyClientConnectionFactory | |
TimeoutCompleteListener | |
ValidatingConnectionPool |
A connection pool that validates connections before
making them available for use.
|
WWWAuthenticationProtocolHandler |
A protocol handler that handles the 401 response code
in association with the
WWW-Authenticate header. |
Exception | Description |
---|---|
HttpRequestException | |
HttpResponseException |
Copyright © 1995–2018 Webtide. All rights reserved.