Package org.apache.http.impl.client
package org.apache.http.impl.client
Default HTTP client implementation.
The usual execution flow can be demonstrated by the code snippet below:
CloseableHttpClient httpclient = HttpClients.createDefault(); try { HttpGet httpGet = new HttpGet("http://targethost/homepage"); CloseableHttpResponse response = httpclient.execute(httpGet); try { System.out.println(response.getStatusLine()); HttpEntity entity = response.getEntity(); // do something useful with the response body // and ensure it is fully consumed EntityUtils.consume(entity); } finally { response.close(); } } finally { httpclient.close(); }
-
ClassDescriptionDeprecated.Deprecated.(4.3) use
HttpClientBuilder
.A genericResponseHandler
that works with the response entity for successful (2xx) responses.TheAIMDBackoffManager
applies an additive increase, multiplicative decrease (AIMD) to managing a dynamic limit to the number of connections allowed to a given host.Deprecated.(4.3) useHttpClientBuilder
.Default implementation ofAuthCache
.Default implementation ofCookieStore
Default implementation ofCredentialsProvider
.AResponseHandler
that returns the response body as a String for successful (2xx) responses.Deprecated.(4.3) use configuration classes provided 'org.apache.http.config' and 'org.apache.http.client.config'Base implementation ofHttpClient
that also implementsCloseable
.Deprecated.(4.2) useHttpClientBuilder
Deprecated.(4.3) useHttpClientBuilder
ThisConnectionBackoffStrategy
backs off either for a raw network socket or connection timeout or if the server explicitly sends a 503 (Service Unavailable) response.Default implementation of a strategy deciding duration that a connection can remain idle.Deprecated.(4.3) useHttpClientBuilder
see alsoCloseableHttpClient
.The defaultHttpRequestRetryHandler
used by request executors.Deprecated.(4.2) useProxyAuthenticationStrategy
Deprecated.(4.1) useDefaultRedirectStrategy
.Default implementation ofRedirectStrategy
.Deprecated.Do not use.Default implementation of theServiceUnavailableRetryStrategy
interface.Deprecated.(4.2) useTargetAuthenticationStrategy
Default implementation ofUserTokenHandler
.Deprecated.(4.3) do not use.Collection of different counters used to gather metrics forFutureRequestExecutionService
.HttpAsyncClientWithFuture wraps calls to execute with aHttpRequestFutureTask
and schedules them using the provided executor service.Deprecated.(4.3) reserved for internal use.Builder forCloseableHttpClient
instances.Factory methods forCloseableHttpClient
instances.FutureTask implementation that wraps a HttpAsyncClientCallable and exposes various task specific metrics.This class maintains a background thread to enforce an eviction policy for expired / idle persistent connections kept alive in the connection pool.LaxRedirectStrategy
implementation that automatically redirects all HEAD, GET, POST, and DELETE requests.Noop implementation ofUserTokenHandler
that always returnsnull
.This is aConnectionBackoffStrategy
that never backs off, for compatibility with existing behavior.DefaultAuthenticationStrategy
implementation for proxy host authentication.ProxyClient can be used to establish a tunnel via an HTTP proxy.This class represents a collection ofURI
s used as redirect locations.Deprecated.(4.3) do not use.Deprecated.(4.3) do not use.HttpRequestRetryHandler
which assumes that all requested HTTP methods which should be idempotent according to RFC-2616 are in fact idempotent and can be retried.Implementation ofCredentialsProvider
backed by standard JREAuthenticator
.Deprecated.(4.3) useHttpClientBuilder
DefaultAuthenticationStrategy
implementation for proxy host authentication.Deprecated.(4.3) reserved for internal use.
AuthenticationStrategy