Deprecated
(4.3) use HttpClientBuilder
Decorator adding support for compressed responses. This class sets
the Accept-Encoding header on requests to indicate
support for the gzip and deflate
compression schemes; it then checks the Content-Encoding
header on the response to uncompress any compressed response bodies.
The java. of the entity will contain the uncompressed
content.
N.B. Any upstream clients of this class need to be aware that
this effectively obscures visibility into the length of a server
response body, since the Content-Length header will
correspond to the compressed entity length received from the server,
but the content length experienced by reading the response body may
be different (hopefully higher!).
That said, this decorator is compatible with the
CachingHttpClient in that the two decorators can be added
in either order and still have cacheable responses be cached.
| Modifier and Type | Field and Description |
|---|---|
| private final HttpRequestInterceptor | |
| private final HttpClient | |
| private final HttpResponseInterceptor |
| Access | Constructor and Description |
|---|---|
| public | DecompressingHttpClient()
Constructs a decorator to ask for and handle compressed entities on the fly. |
| public | DecompressingHttpClient(final HttpClient
the backend)HttpClient to use for actually
issuing requestsConstructs a decorator to ask for and handle compressed entities on the fly. |
| pack-priv | DecompressingHttpClient(final HttpClient backend, final HttpRequestInterceptor requestInterceptor, final HttpResponseInterceptor responseInterceptor)
|
| Modifier and Type | Method and Description |
|---|---|
| public HttpResponse | execute(final HttpUriRequest
the request to execute request)Implements org. |
| public HttpResponse | execute(final HttpUriRequest
the request to execute request, final HttpContext the context to use for the execution, or
context)null to use the default contextImplements org. |
| public HttpResponse | execute(final HttpHost
the target host for the request.
Implementations may accept target, final HttpRequest null
if they can still determine a route, for example
to a default target or by inspecting the request.the request to execute request)Implements org. |
| public HttpResponse | execute(final HttpHost
the target host for the request.
Implementations may accept target, final HttpRequest null
if they can still determine a route, for example
to a default target or by inspecting the request.the request to execute request, final HttpContext the context to use for the execution, or
context)null to use the default contextImplements org. |
| public <T> T | execute(final HttpUriRequest
the request to execute request, final ResponseHandler<? extends T> the response handler responseHandler)Implements org. |
| public <T> T | execute(final HttpUriRequest
the request to execute request, final ResponseHandler<? extends T> the response handler responseHandler, final HttpContext the context to use for the execution, or
context)null to use the default contextImplements org. |
| public <T> T | execute(final HttpHost
the target host for the request.
Implementations may accept target, final HttpRequest null
if they can still determine a route, for example
to a default target or by inspecting the request.the request to execute request, final ResponseHandler<? extends T> the response handler responseHandler)Implements org. |
| public <T> T | execute(final HttpHost
the target host for the request.
Implementations may accept target, final HttpRequest null
if they can still determine a route, for example
to a default target or by inspecting the request.the request to execute request, final ResponseHandler<? extends T> the response handler responseHandler, final HttpContext the context to use for the execution, or
context)null to use the default contextImplements org. |
| public ClientConnectionManager | getConnectionManager()
Implements org.
Deprecated
as a consequence of
Obtains the connection manager used by this client.
ClientConnectionManager being deprecated.
|
| public HttpClient | |
| pack-priv HttpHost | |
| public HttpParams | getParams()
Implements org.
Deprecated
as a consequence of
Obtains the parameters for this client.
HttpParams being deprecated.
|
| acceptEncodingInterceptor | back to summary |
|---|---|
| private final HttpRequestInterceptor acceptEncodingInterceptor | |
| backend | back to summary |
|---|---|
| private final HttpClient backend | |
| contentEncodingInterceptor | back to summary |
|---|---|
| private final HttpResponseInterceptor contentEncodingInterceptor | |
| DecompressingHttpClient | back to summary |
|---|---|
| public DecompressingHttpClient() Constructs a decorator to ask for and handle compressed entities on the fly. | |
| DecompressingHttpClient | back to summary |
|---|---|
| public DecompressingHttpClient(final HttpClient backend) Constructs a decorator to ask for and handle compressed entities on the fly.
| |
| DecompressingHttpClient | back to summary |
|---|---|
| pack-priv DecompressingHttpClient(final HttpClient backend, final HttpRequestInterceptor requestInterceptor, final HttpResponseInterceptor responseInterceptor) | |
| execute | back to summary |
|---|---|
| public HttpResponse execute(final HttpUriRequest request) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request using the default context.
| |
| execute | back to summary |
|---|---|
| public HttpResponse execute(final HttpUriRequest request, final HttpContext context) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request using the given context.
| |
| execute | back to summary |
|---|---|
| public HttpResponse execute(final HttpHost target, final HttpRequest request) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request using the default context.
| |
| execute | back to summary |
|---|---|
| public HttpResponse execute(final HttpHost target, final HttpRequest request, final HttpContext context) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request using the given context.
| |
| execute | back to summary |
|---|---|
| public <T> T execute(final HttpUriRequest request, final ResponseHandler<? extends T> responseHandler) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request using the default context and processes the response using the given response handler.
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual
| |
| execute | back to summary |
|---|---|
| public <T> T execute(final HttpUriRequest request, final ResponseHandler<? extends T> responseHandler, final HttpContext context) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request using the given context and processes the response using the given response handler.
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual
| |
| execute | back to summary |
|---|---|
| public <T> T execute(final HttpHost target, final HttpRequest request, final ResponseHandler<? extends T> responseHandler) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request to the target using the default context and processes the response using the given response handler.
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual
| |
| execute | back to summary |
|---|---|
| public <T> T execute(final HttpHost target, final HttpRequest request, final ResponseHandler<? extends T> responseHandler, final HttpContext context) throws IOException, ClientProtocolException Implements org. Doc from org. Executes HTTP request to the target using the given context and processes the response using the given response handler.
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual
| |
| getConnectionManager | back to summary |
|---|---|
| public ClientConnectionManager getConnectionManager() Implements org. Doc from org. Deprecated as a consequence of Obtains the connection manager used by this client.
| |
| getHttpClient | back to summary |
|---|---|
| public HttpClient getHttpClient() Gets the HttpClient to issue request.
| |
| getHttpHost | back to summary |
|---|---|
| pack-priv HttpHost getHttpHost(final HttpUriRequest request) | |
| getParams | back to summary |
|---|---|
| public HttpParams getParams() Implements org. Doc from org. Deprecated as a consequence of Obtains the parameters for this client. These parameters will become defaults for all requests being executed with this client, and for the parameters of dependent objects in this client.
| |