HttpClientBuilder@Deprecated
public class DecompressingHttpClient
extends java.lang.Object
implements org.apache.http.client.HttpClient
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 InputStream 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.
| Constructor and Description |
|---|
DecompressingHttpClient()
Deprecated.
Constructs a decorator to ask for and handle compressed
entities on the fly.
|
DecompressingHttpClient(org.apache.http.client.HttpClient backend)
Deprecated.
Constructs a decorator to ask for and handle compressed
entities on the fly.
|
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
execute(HttpHost target,
HttpRequest request)
Deprecated.
|
HttpResponse |
execute(HttpHost target,
HttpRequest request,
org.apache.http.protocol.HttpContext context)
Deprecated.
|
<T> T |
execute(HttpHost target,
HttpRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler)
Deprecated.
|
<T> T |
execute(HttpHost target,
HttpRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext context)
Deprecated.
|
HttpResponse |
execute(HttpUriRequest request)
Deprecated.
|
HttpResponse |
execute(HttpUriRequest request,
org.apache.http.protocol.HttpContext context)
Deprecated.
|
<T> T |
execute(HttpUriRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler)
Deprecated.
|
<T> T |
execute(HttpUriRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext context)
Deprecated.
|
org.apache.http.conn.ClientConnectionManager |
getConnectionManager()
Deprecated.
|
org.apache.http.client.HttpClient |
getHttpClient()
Deprecated.
Gets the HttpClient to issue request.
|
org.apache.http.params.HttpParams |
getParams()
Deprecated.
|
public DecompressingHttpClient()
public DecompressingHttpClient(org.apache.http.client.HttpClient backend)
backend - the HttpClient to use for actually
issuing requestspublic org.apache.http.params.HttpParams getParams()
getParams in interface org.apache.http.client.HttpClientpublic org.apache.http.conn.ClientConnectionManager getConnectionManager()
getConnectionManager in interface org.apache.http.client.HttpClientpublic HttpResponse execute(HttpUriRequest request) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic org.apache.http.client.HttpClient getHttpClient()
public HttpResponse execute(HttpUriRequest request, org.apache.http.protocol.HttpContext context) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic HttpResponse execute(HttpHost target, HttpRequest request) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic HttpResponse execute(HttpHost target, HttpRequest request, org.apache.http.protocol.HttpContext context) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(HttpUriRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(HttpUriRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler, org.apache.http.protocol.HttpContext context) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(HttpHost target, HttpRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(HttpHost target, HttpRequest request, org.apache.http.client.ResponseHandler<? extends T> responseHandler, org.apache.http.protocol.HttpContext context) throws java.io.IOException, org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientjava.io.IOExceptionorg.apache.http.client.ClientProtocolException