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();
}
| Modifier and Type | Interface and Description |
|---|---|
| pack-priv interface | Clock
Interface used to enable easier testing of time-related behavior. |
| Modifier and Type | Class and Description |
|---|---|
| public abstract class | AbstractAuthenticationHandler
Deprecated
(4.2) use Base class for org.
AuthenticationHandler implementations.
|
| public abstract class | AbstractHttpClient
Deprecated
(4.3) use Base class for HttpClientBuilder.
org. implementations.
|
| public abstract class | AbstractResponseHandler<T>
A generic |
| public class | AIMDBackoffManager
The |
| pack-priv class | AuthenticationStrategyAdaptor
Deprecated
(4.2) do not use
|
| pack-priv abstract class | |
| public class | AutoRetryHttpClient
Deprecated
(4.3) use HttpClientBuilder.
HttpClient implementation that can automatically retry the request in case of
a non-2xx response using the ServiceUnavailableRetryStrategy interface.
|
| public class | BasicAuthCache
Default implementation of |
| public class | BasicCookieStore
Default implementation of |
| public class | BasicCredentialsProvider
Default implementation of |
| public class | BasicResponseHandler
A |
| public class | ClientParamsStack
Deprecated
(4.3) use configuration classes provided 'org.apache.http.config'
and 'org.apache.http.client.config'
Represents a stack of parameter collections.
|
| public abstract class | CloseableHttpClient
Base implementation of |
| pack-priv class | CloseableHttpResponseProxy
Deprecated
Do not use.
|
| public class | ContentEncodingHttpClient
Deprecated
(4.2) use HttpClientBuilder
DefaultHttpClient sub-class which includes a RequestAcceptEncoding
for the request and response.
|
| public class | |
| public class | DecompressingHttpClient
Deprecated
(4.3) use HttpClientBuilder
Decorator adding support for compressed responses. |
| public class | DefaultBackoffStrategy
This |
| public class | |
| public class | DefaultConnectionKeepAliveStrategy
Default implementation of a strategy deciding duration that a connection can remain idle. |
| public class | DefaultHttpClient
Deprecated
(4.3) use Default implementation of HttpClientBuilder see also CloseableHttpClient.
org. pre-configured
for most common use scenarios.
|
| public class | DefaultHttpRequestRetryHandler
The default |
| public class | DefaultProxyAuthenticationHandler
Deprecated
(4.2) use Default ProxyAuthenticationStrategy
org. implementation
for proxy host authentication.
|
| public class | DefaultRedirectHandler
Deprecated
(4.1) use Default implementation of DefaultRedirectStrategy.
RedirectHandler.
|
| public class | DefaultRedirectStrategy
Default implementation of |
| pack-priv class | DefaultRedirectStrategyAdaptor
Deprecated
(4.1) do not use
|
| public class | |
| public class | DefaultServiceUnavailableRetryStrategy
Default implementation of the |
| public class | DefaultTargetAuthenticationHandler
Deprecated
(4.2) use Default TargetAuthenticationStrategy
org. implementation
for target host authentication.
|
| public class | DefaultUserTokenHandler
Default implementation of |
| public class | EntityEnclosingRequestWrapper
Deprecated
(4.3) do not use.
A wrapper class for HttpEntityEnclosingRequests that can
be used to change properties of the current request without
modifying the original object.
|
| public class | FutureRequestExecutionMetrics
Collection of different counters used to gather metrics for |
| public class | FutureRequestExecutionService
HttpAsyncClientWithFuture wraps calls to execute with a |
| public class | HttpAuthenticator
Deprecated
(4.3) reserved for internal use.
|
| public class | HttpClientBuilder
Builder for |
| public class | HttpClients
Factory methods for |
| public class | HttpRequestFutureTask<V>
FutureTask implementation that wraps a HttpAsyncClientCallable and exposes various task specific metrics. |
| pack-priv class | |
| public class | IdleConnectionEvictor
This class maintains a background thread to enforce an eviction policy for expired / idle persistent connections kept alive in the connection pool. |
| pack-priv class | InternalHttpClient
Internal class. |
| public class | LaxRedirectStrategy
Lax |
| pack-priv class | MinimalHttpClient
Internal class. |
| public class | NoopUserTokenHandler
Noop implementation of |
| public class | NullBackoffStrategy
This is a |
| public class | ProxyAuthenticationStrategy
Default |
| public class | ProxyClient
ProxyClient can be used to establish a tunnel via an HTTP proxy. |
| public class | RedirectLocations
This class represents a collection of |
| public class | RequestWrapper
Deprecated
(4.3) do not use.
A wrapper class for HttpRequests that can be used to change
properties of the current request without modifying the original
object.
|
| public class | RoutedRequest
Deprecated
(4.3) do not use.
A request with the route along which it should be sent.
|
| public class | StandardHttpRequestRetryHandler
|
| pack-priv class | SystemClock
The actual system clock. |
| public class | SystemDefaultCredentialsProvider
Implementation of |
| public class | SystemDefaultHttpClient
Deprecated
(4.3) use An extension of HttpClientBuilder
DefaultHttpClient pre-configured using system properties.
|
| public class | TargetAuthenticationStrategy
Default |
| public class | TunnelRefusedException
Deprecated
(4.3) reserved for internal use.
Signals that the tunnel request was rejected by the proxy host.
|