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 genericResponseHandlerthat works with the response entity for successful (2xx) responses.TheAIMDBackoffManagerapplies 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 ofCookieStoreDefault implementation ofCredentialsProvider.AResponseHandlerthat 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 ofHttpClientthat also implementsCloseable.Deprecated.(4.2) useHttpClientBuilderDeprecated.(4.3) useHttpClientBuilderThisConnectionBackoffStrategybacks 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) useHttpClientBuildersee alsoCloseableHttpClient.The defaultHttpRequestRetryHandlerused by request executors.Deprecated.(4.2) useProxyAuthenticationStrategyDeprecated.(4.1) useDefaultRedirectStrategy.Default implementation ofRedirectStrategy.Deprecated.Do not use.Default implementation of theServiceUnavailableRetryStrategyinterface.Deprecated.(4.2) useTargetAuthenticationStrategyDefault implementation ofUserTokenHandler.Deprecated.(4.3) do not use.Collection of different counters used to gather metrics forFutureRequestExecutionService.HttpAsyncClientWithFuture wraps calls to execute with aHttpRequestFutureTaskand schedules them using the provided executor service.Deprecated.(4.3) reserved for internal use.Builder forCloseableHttpClientinstances.Factory methods forCloseableHttpClientinstances.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.LaxRedirectStrategyimplementation that automatically redirects all HEAD, GET, POST, and DELETE requests.Noop implementation ofUserTokenHandlerthat always returnsnull.This is aConnectionBackoffStrategythat never backs off, for compatibility with existing behavior.DefaultAuthenticationStrategyimplementation for proxy host authentication.ProxyClient can be used to establish a tunnel via an HTTP proxy.This class represents a collection ofURIs used as redirect locations.Deprecated.(4.3) do not use.Deprecated.(4.3) do not use.HttpRequestRetryHandlerwhich assumes that all requested HTTP methods which should be idempotent according to RFC-2616 are in fact idempotent and can be retried.Implementation ofCredentialsProviderbacked by standard JREAuthenticator.Deprecated.(4.3) useHttpClientBuilderDefaultAuthenticationStrategyimplementation for proxy host authentication.Deprecated.(4.3) reserved for internal use.
AuthenticationStrategy