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();
}
-
Class Summary Class Description AIMDBackoffManager TheAIMDBackoffManagerapplies an additive increase, multiplicative decrease (AIMD) to managing a dynamic limit to the number of connections allowed to a given host.BasicAuthCache Default implementation ofAuthCache.BasicCookieStore Default implementation ofCookieStoreBasicCredentialsProvider Default implementation ofCredentialsProvider.BasicResponseHandler AResponseHandlerthat returns the response body as a String for successful (2xx) responses.CloseableHttpClient Base implementation ofHttpClientthat also implementsCloseable.DefaultBackoffStrategy ThisConnectionBackoffStrategybacks off either for a raw network socket or connection timeout or if the server explicitly sends a 503 (Service Unavailable) response.DefaultConnectionKeepAliveStrategy Default implementation of a strategy deciding duration that a connection can remain idle.DefaultHttpRequestRetryHandler The defaultHttpRequestRetryHandlerused by request executors.DefaultRedirectStrategy Default implementation ofRedirectStrategy.DefaultServiceUnavailableRetryStrategy Default implementation of theServiceUnavailableRetryStrategyinterface.DefaultUserTokenHandler Default implementation ofUserTokenHandler.EntityEnclosingRequestWrapper Deprecated. (4.3) do not use.FutureRequestExecutionMetrics Collection of different counters used to gather metrics forFutureRequestExecutionService.FutureRequestExecutionService HttpAsyncClientWithFuture wraps calls to execute with aHttpRequestFutureTaskand schedules them using the provided executor service.HttpClientBuilder Builder forCloseableHttpClientinstances.HttpClients Factory methods forCloseableHttpClientinstances.HttpRequestFutureTask<V> FutureTask implementation that wraps a HttpAsyncClientCallable and exposes various task specific metrics.LaxRedirectStrategy LaxRedirectStrategyimplementation that automatically redirects all HEAD, GET and POST requests.NoopUserTokenHandler Noop implementation ofUserTokenHandlerthat always returnsnull.NullBackoffStrategy This is aConnectionBackoffStrategythat never backs off, for compatibility with existing behavior.ProxyAuthenticationStrategy DefaultAuthenticationStrategyimplementation for proxy host authentication.ProxyClient ProxyClient can be used to establish a tunnel via an HTTP proxy.RedirectLocations This class represents a collection ofURIs used as redirect locations.RequestWrapper Deprecated. (4.3) do not use.StandardHttpRequestRetryHandler HttpRequestRetryHandlerwhich assumes that all requested HTTP methods which should be idempotent according to RFC-2616 are in fact idempotent and can be retried.SystemDefaultCredentialsProvider Implementation ofCredentialsProviderbacked by standard JREAuthenticator.TargetAuthenticationStrategy DefaultAuthenticationStrategyimplementation for proxy host authentication.