Class DefaultHttpClient

All Implemented Interfaces:
Closeable, AutoCloseable, HttpClient
Direct Known Subclasses:
ContentEncodingHttpClient, SystemDefaultHttpClient

@Contract(threading=SAFE_CONDITIONAL) @Deprecated public class DefaultHttpClient extends AbstractHttpClient
Deprecated.
Default implementation of HttpClient pre-configured for most common use scenarios.

Please see the Javadoc for createHttpProcessor() for the details of the interceptors that are set up by default.

Additional interceptors can be added as follows, but take care not to add the same interceptor more than once.

 DefaultHttpClient httpclient = new DefaultHttpClient();
 httpclient.addRequestInterceptor(new RequestAcceptEncoding());
 httpclient.addResponseInterceptor(new ResponseContentEncoding());
 

This class sets up the following parameters if not explicitly set:

  • Version: HttpVersion.HTTP_1_1
  • ContentCharset: HTTP.DEFAULT_CONTENT_CHARSET
  • NoTcpDelay: true
  • SocketBufferSize: 8192
  • UserAgent: Apache-HttpClient/release (java 1.5)

The following parameters can be used to customize the behavior of this class:

Since:
4.0