org.apache.http.impl.client
Class DefaultHttpClient

java.lang.Object
  extended by org.apache.http.impl.client.AbstractHttpClient
      extended by org.apache.http.impl.client.DefaultHttpClient
All Implemented Interfaces:
org.apache.http.client.HttpClient

@ThreadSafe
public class DefaultHttpClient
extends org.apache.http.impl.client.AbstractHttpClient

Default implementation of HttpClient pre-configured for most common use scenarios.

This class creates the following chain of protocol interceptors per default:

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

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

Since:
4.0

Constructor Summary
DefaultHttpClient()
           
DefaultHttpClient(org.apache.http.conn.ClientConnectionManager conman)
           
DefaultHttpClient(org.apache.http.conn.ClientConnectionManager conman, org.apache.http.params.HttpParams params)
          Creates a new HTTP client from parameters and a connection manager.
DefaultHttpClient(org.apache.http.params.HttpParams params)
           
 
Method Summary
protected  org.apache.http.params.HttpParams createHttpParams()
          Creates the default set of HttpParams by invoking setDefaultHttpParams(HttpParams)
protected  org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
           
static void setDefaultHttpParams(org.apache.http.params.HttpParams params)
          Saves the default set of HttpParams in the provided parameter.
 
Methods inherited from class org.apache.http.impl.client.AbstractHttpClient
addRequestInterceptor, addRequestInterceptor, addResponseInterceptor, addResponseInterceptor, clearRequestInterceptors, clearResponseInterceptors, createAuthSchemeRegistry, createClientConnectionManager, createClientRequestDirector, createClientRequestDirector, createConnectionKeepAliveStrategy, createConnectionReuseStrategy, createCookieSpecRegistry, createCookieStore, createCredentialsProvider, createHttpContext, createHttpRequestRetryHandler, createHttpRoutePlanner, createProxyAuthenticationHandler, createRedirectHandler, createRequestExecutor, createTargetAuthenticationHandler, createUserTokenHandler, determineParams, execute, execute, execute, execute, execute, execute, execute, execute, getAuthSchemes, getConnectionKeepAliveStrategy, getConnectionManager, getConnectionReuseStrategy, getCookieSpecs, getCookieStore, getCredentialsProvider, getHttpProcessor, getHttpRequestRetryHandler, getParams, getProxyAuthenticationHandler, getRedirectHandler, getRedirectStrategy, getRequestExecutor, getRequestInterceptor, getRequestInterceptorCount, getResponseInterceptor, getResponseInterceptorCount, getRoutePlanner, getTargetAuthenticationHandler, getUserTokenHandler, removeRequestInterceptorByClass, removeResponseInterceptorByClass, setAuthSchemes, setCookieSpecs, setCookieStore, setCredentialsProvider, setHttpRequestRetryHandler, setKeepAliveStrategy, setParams, setProxyAuthenticationHandler, setRedirectHandler, setRedirectStrategy, setReuseStrategy, setRoutePlanner, setTargetAuthenticationHandler, setUserTokenHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpClient

public DefaultHttpClient(org.apache.http.conn.ClientConnectionManager conman,
                         org.apache.http.params.HttpParams params)
Creates a new HTTP client from parameters and a connection manager.

Parameters:
params - the parameters
conman - the connection manager

DefaultHttpClient

public DefaultHttpClient(org.apache.http.conn.ClientConnectionManager conman)
Since:
4.1

DefaultHttpClient

public DefaultHttpClient(org.apache.http.params.HttpParams params)

DefaultHttpClient

public DefaultHttpClient()
Method Detail

createHttpParams

protected org.apache.http.params.HttpParams createHttpParams()
Creates the default set of HttpParams by invoking setDefaultHttpParams(HttpParams)

Specified by:
createHttpParams in class org.apache.http.impl.client.AbstractHttpClient
Returns:
a new instance of SyncBasicHttpParams with the defaults applied to it.

setDefaultHttpParams

public static void setDefaultHttpParams(org.apache.http.params.HttpParams params)
Saves the default set of HttpParams in the provided parameter. These are:


createHttpProcessor

protected org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
Specified by:
createHttpProcessor in class org.apache.http.impl.client.AbstractHttpClient