Deprecated
(4.3) use HttpClientBuilder see also CloseableHttpClient.
org.apache.http.client.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:
The following parameters can be used to customize the behavior of this class:
org.apache.http.params.CoreProtocolPNames#PROTOCOL_VERSION org.apache.http.params.CoreProtocolPNames#STRICT_TRANSFER_ENCODING org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET org.apache.http.params.CoreProtocolPNames#USE_EXPECT_CONTINUE org.apache.http.params.CoreProtocolPNames#WAIT_FOR_CONTINUE org.apache.http.params.CoreProtocolPNames#USER_AGENT org.apache.http.params.CoreConnectionPNames#TCP_NODELAY org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT org.apache.http.params.CoreConnectionPNames#SO_LINGER org.apache.http.params.CoreConnectionPNames#SO_REUSEADDR org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE org.apache.http.params.CoreConnectionPNames#CONNECTION_TIMEOUT org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT org.apache.http.params.CoreConnectionPNames#STALE_CONNECTION_CHECK org.apache.http.conn.params.ConnRoutePNames#FORCED_ROUTE org.apache.http.conn.params.ConnRoutePNames#LOCAL_ADDRESS org.apache.http.conn.params.ConnRoutePNames#DEFAULT_PROXY org.apache.http.cookie.params.CookieSpecPNames#DATE_PATTERNS org.apache.http.cookie.params.CookieSpecPNames#SINGLE_COOKIE_HEADER org.apache.http.auth.params.AuthPNames#CREDENTIAL_CHARSET org.apache.http.client.params.ClientPNames#COOKIE_POLICY org.apache.http.client.params.ClientPNames#HANDLE_AUTHENTICATION org.apache.http.client.params.ClientPNames#HANDLE_REDIRECTS org.apache.http.client.params.ClientPNames#MAX_REDIRECTS org.apache.http.client.params.ClientPNames#ALLOW_CIRCULAR_REDIRECTS org.apache.http.client.params.ClientPNames#VIRTUAL_HOST org.apache.http.client.params.ClientPNames#DEFAULT_HOST org.apache.http.client.params.ClientPNames#DEFAULT_HEADERS org.apache.http.client.params.ClientPNames#CONN_MANAGER_TIMEOUT | Access | Constructor and Description |
|---|---|
| public | DefaultHttpClient(final ClientConnectionManager
the connection manager conman, final HttpParams the parameters params)
Deprecated
as a consequence of
Creates a new HTTP client from parameters and a connection manager.
ClientConnectionManager and HttpParams being deprecated.
|
| public | DefaultHttpClient(final ClientConnectionManager conman)
Deprecated
as a consequence of
ClientConnectionManager being deprecated.
|
| public | DefaultHttpClient(final HttpParams params)
Deprecated
as a consequence of
HttpParams being deprecated.
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected HttpParams | Returns: a new instance ofSyncBasicHttpParams with the defaults applied to it.Implements abstract org.
Deprecated
as a consequence of
Creates the default set of HttpParams by invoking HttpParams being deprecated.
DefaultHttpClient#setDefaultHttpParams(HttpParams)
|
| protected BasicHttpProcessor | Returns: the processor with the added interceptors.Implements abstract org.
Deprecated
as a consequence of
Create the processor with the following interceptors:
BasicHttpProcessor being deprecated.
|
| public static void | setDefaultHttpParams(final HttpParams params)
Deprecated
as a consequence of
Saves the default set of HttpParams in the provided parameter.
HttpParams being deprecated.
|
| DefaultHttpClient | back to summary |
|---|---|
| public DefaultHttpClient(final ClientConnectionManager conman, final HttpParams params)
Deprecated as a consequence of Creates a new HTTP client from parameters and a connection manager.
| |
| DefaultHttpClient | back to summary |
|---|---|
| public DefaultHttpClient(final ClientConnectionManager conman)
Deprecated as a consequence of
| |
| DefaultHttpClient | back to summary |
|---|---|
| public DefaultHttpClient(final HttpParams params)
Deprecated as a consequence of | |
| DefaultHttpClient | back to summary |
|---|---|
| public DefaultHttpClient() | |
| createHttpParams | back to summary |
|---|---|
| protected HttpParams createHttpParams() Implements abstract org. Deprecated as a consequence of Creates the default set of HttpParams by invoking
| |
| createHttpProcessor | back to summary |
|---|---|
| protected BasicHttpProcessor createHttpProcessor() Implements abstract org. Deprecated as a consequence of Create the processor with the following interceptors:
| |
| setDefaultHttpParams | back to summary |
|---|---|
| public static void setDefaultHttpParams(final HttpParams params)
Deprecated as a consequence of Saves the default set of HttpParams in the provided parameter. These are:
| |