Deprecated
(4.3) use HttpClientBuilder.
org.apache.http.client.HttpClient implementations.
This class acts as a facade to a number of special purpose handler or
strategy implementations responsible for handling of a particular aspect
of the HTTP protocol such as redirect or authentication handling or
making decision about connection persistence and keep alive duration.
This enables the users to selectively replace default implementation
of those aspects with custom, application specific ones. This class
also provides factory methods to instantiate those objects:
HttpRequestExecutor object used to transmit messages
over HTTP connections. The createRequestExecutor() must be
implemented by concrete super classes to instantiate this object.
BasicHttpProcessor object to manage a list of protocol
interceptors and apply cross-cutting protocol logic to all incoming
and outgoing HTTP messages. The createHttpProcessor() must be
implemented by concrete super classes to instantiate this object.
HttpRequestRetryHandler object used to decide whether
or not a failed HTTP request is safe to retry automatically.
The createHttpRequestRetryHandler() must be
implemented by concrete super classes to instantiate this object.
ClientConnectionManager object used to manage
persistent HTTP connections.
ConnectionReuseStrategy object used to decide whether
or not a HTTP connection can be kept alive and re-used for subsequent
HTTP requests. The createConnectionReuseStrategy() must be
implemented by concrete super classes to instantiate this object.
ConnectionKeepAliveStrategy object used to decide how
long a persistent HTTP connection can be kept alive.
The createConnectionKeepAliveStrategy() must be
implemented by concrete super classes to instantiate this object.
CookieSpecRegistry object used to maintain a list of
supported cookie specifications.
The createCookieSpecRegistry() must be implemented by concrete
super classes to instantiate this object.
CookieStore object used to maintain a collection of
cookies. The createCookieStore() must be implemented by
concrete super classes to instantiate this object.
AuthSchemeRegistry object used to maintain a list of
supported authentication schemes.
The createAuthSchemeRegistry() must be implemented by concrete
super classes to instantiate this object.
CredentialsProvider object used to maintain
a collection user credentials. The createCredentialsProvider()
must be implemented by concrete super classes to instantiate
this object.
AuthenticationStrategy object used to authenticate
against the target host.
The createTargetAuthenticationStrategy() must be implemented
by concrete super classes to instantiate this object.
AuthenticationStrategy object used to authenticate
against the proxy host.
The createProxyAuthenticationStrategy() must be implemented
by concrete super classes to instantiate this object.
HttpRoutePlanner object used to calculate a route
for establishing a connection to the target host. The route
may involve multiple intermediate hops.
The createHttpRoutePlanner() must be implemented
by concrete super classes to instantiate this object.
RedirectStrategy object used to determine if an HTTP
request should be redirected to a new location in response to an HTTP
response received from the target server.
UserTokenHandler object used to determine if the
execution context is user identity specific.
The createUserTokenHandler() must be implemented by
concrete super classes to instantiate this object.
This class also maintains a list of protocol interceptors intended
for processing outgoing requests and incoming responses and provides
methods for managing those interceptors. New protocol interceptors can be
introduced to the protocol processor chain or removed from it if needed.
Internally protocol interceptors are stored in a simple
java.. They are executed in the same natural order
as they are added to the list.
AbstractHttpClient is thread safe. It is recommended that the same
instance of this class is reused for multiple request executions.
When an instance of DefaultHttpClient is no longer needed and is about
to go out of scope the connection manager associated with it must be
shut down by calling ClientConnectionManager#shutdown()!
| Access | Constructor and Description |
|---|---|
| protected | AbstractHttpClient(final ClientConnectionManager
the connection manager conman, final HttpParams the parameters params)
Deprecated
as a consequence of
Creates a new HTTP client.
ClientConnectionManager and HttpParams being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public void | close()
Implements java. |
| protected AuthSchemeRegistry | |
| protected ClientConnectionManager | createClientConnectionManager()
Deprecated
as a consequence of
ClientConnectionManager being deprecated.
|
| protected RequestDirector | createClientRequestDirector(final HttpRequestExecutor requestExec, final ClientConnectionManager conman, final ConnectionReuseStrategy reustrat, final ConnectionKeepAliveStrategy kastrat, final HttpRoutePlanner rouplan, final HttpProcessor httpProcessor, final HttpRequestRetryHandler retryHandler, final RedirectHandler redirectHandler, final AuthenticationHandler targetAuthHandler, final AuthenticationHandler proxyAuthHandler, final UserTokenHandler userTokenHandler, final HttpParams params)
Deprecated
(4.1) do not use
|
| protected RequestDirector | createClientRequestDirector(final HttpRequestExecutor requestExec, final ClientConnectionManager conman, final ConnectionReuseStrategy reustrat, final ConnectionKeepAliveStrategy kastrat, final HttpRoutePlanner rouplan, final HttpProcessor httpProcessor, final HttpRequestRetryHandler retryHandler, final RedirectStrategy redirectStrategy, final AuthenticationHandler targetAuthHandler, final AuthenticationHandler proxyAuthHandler, final UserTokenHandler userTokenHandler, final HttpParams params)
Deprecated
(4.2) do not use
|
| protected RequestDirector | createClientRequestDirector(final HttpRequestExecutor requestExec, final ClientConnectionManager conman, final ConnectionReuseStrategy reustrat, final ConnectionKeepAliveStrategy kastrat, final HttpRoutePlanner rouplan, final HttpProcessor httpProcessor, final HttpRequestRetryHandler retryHandler, final RedirectStrategy redirectStrategy, final AuthenticationStrategy targetAuthStrategy, final AuthenticationStrategy proxyAuthStrategy, final UserTokenHandler userTokenHandler, final HttpParams params)
Deprecated
as a consequence of
ClientConnectionManager, HttpParams and RequestDirector being deprecated.
|
| protected ConnectionKeepAliveStrategy | |
| protected ConnectionReuseStrategy | |
| protected CookieSpecRegistry | |
| protected CookieStore | |
| protected CredentialsProvider | |
| protected HttpContext | |
| protected abstract HttpParams | |
| protected abstract BasicHttpProcessor | |
| protected HttpRequestRetryHandler | |
| protected HttpRoutePlanner | |
| protected AuthenticationHandler | |
| protected AuthenticationStrategy | |
| protected RedirectHandler | |
| protected HttpRequestExecutor | |
| protected AuthenticationHandler | |
| protected AuthenticationStrategy | |
| protected UserTokenHandler | |
| protected HttpParams | Returns: the parameters to usethe request that will be executed req)
Deprecated
as a consequence of
Obtains parameters for executing a request.
HttpParams being deprecated.
|
| protected final CloseableHttpResponse | doExecute(final HttpHost target, final HttpRequest request, final HttpContext context)
Implements abstract org. |
| public final synchronized AuthSchemeRegistry | |
| public final synchronized BackoffManager | |
| public final synchronized ConnectionBackoffStrategy | |
| public final synchronized ConnectionKeepAliveStrategy | |
| public final synchronized ClientConnectionManager | getConnectionManager()
Implements org.
Deprecated
as a consequence of
Obtains the connection manager used by this client.
ClientConnectionManager being deprecated.
|
| public final synchronized ConnectionReuseStrategy | |
| public final synchronized CookieSpecRegistry | |
| public final synchronized CookieStore | |
| public final synchronized CredentialsProvider | |
| protected final synchronized BasicHttpProcessor | |
| public final synchronized HttpRequestRetryHandler | |
| public final synchronized HttpParams | getParams()
Implements org.
Deprecated
as a consequence of
Obtains the parameters for this client.
HttpParams being deprecated.
|
| private synchronized HttpProcessor | |
| public final synchronized AuthenticationHandler | |
| public final synchronized AuthenticationStrategy | |
| public final synchronized RedirectHandler | |
| public final synchronized RedirectStrategy | |
| public final synchronized HttpRequestExecutor | |
| public synchronized HttpRequestInterceptor | |
| public synchronized int | |
| public synchronized HttpResponseInterceptor | |
| public synchronized int | |
| public final synchronized HttpRoutePlanner | |
| public final synchronized AuthenticationHandler | |
| public final synchronized AuthenticationStrategy | |
| public final synchronized UserTokenHandler | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | setAuthSchemes(final AuthSchemeRegistry registry)
Deprecated
as a consequence of
AuthSchemeRegistry being deprecated.
|
| public synchronized void | |
| public synchronized void | |
| public synchronized void | setCookieSpecs(final CookieSpecRegistry registry)
Deprecated
as a consequence of
CookieSpecRegistry being deprecated.
|
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | setParams(final HttpParams
the new default parameters params)
Deprecated
as a consequence of
Replaces the parameters.
HttpParams being deprecated.
|
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void |