Package org.apache.http.impl.client
Class DefaultHttpClient
java.lang.Object
org.apache.http.impl.client.AbstractHttpClient
org.apache.http.impl.client.DefaultHttpClient
- All Implemented Interfaces:
HttpClient
public class DefaultHttpClient extends AbstractHttpClient
Default implementation of an HTTP client.
Prefer HttpURLConnection for new code
Android includes two HTTP clients:HttpURLConnection and Apache HTTP
Client. Both support HTTPS, streaming uploads and downloads, configurable
timeouts, IPv6 and connection pooling. Apache HTTP client has fewer bugs in
Android 2.2 (Froyo) and earlier releases. For Android 2.3 (Gingerbread) and
later, HttpURLConnection is the best
choice. Its simple API and small size makes it great fit for Android.
Transparent compression and response caching reduce network use, improve
speed and save battery. See the Android
Developers Blog for a comparison of the two HTTP clients.- Since:
- 4.0
- Version:
- $Revision: 677250 $
- Author:
- Roland Weber, Oleg Kalnichevski
-
Constructor Summary
Constructors Constructor Description DefaultHttpClient()DefaultHttpClient(ClientConnectionManager conman, HttpParams params)Creates a new HTTP client from parameters and a connection manager.DefaultHttpClient(HttpParams params) -
Method Summary
Modifier and Type Method Description protected AuthSchemeRegistrycreateAuthSchemeRegistry()protected ClientConnectionManagercreateClientConnectionManager()protected ConnectionKeepAliveStrategycreateConnectionKeepAliveStrategy()protected ConnectionReuseStrategycreateConnectionReuseStrategy()protected CookieSpecRegistrycreateCookieSpecRegistry()protected CookieStorecreateCookieStore()protected CredentialsProvidercreateCredentialsProvider()protected HttpContextcreateHttpContext()protected HttpParamscreateHttpParams()protected BasicHttpProcessorcreateHttpProcessor()protected HttpRequestRetryHandlercreateHttpRequestRetryHandler()protected HttpRoutePlannercreateHttpRoutePlanner()protected AuthenticationHandlercreateProxyAuthenticationHandler()protected RedirectHandlercreateRedirectHandler()protected HttpRequestExecutorcreateRequestExecutor()protected AuthenticationHandlercreateTargetAuthenticationHandler()protected UserTokenHandlercreateUserTokenHandler()Methods inherited from class org.apache.http.impl.client.AbstractHttpClient
addRequestInterceptor, addRequestInterceptor, addResponseInterceptor, addResponseInterceptor, clearRequestInterceptors, clearResponseInterceptors, createClientRequestDirector, determineParams, execute, execute, execute, execute, execute, execute, execute, execute, getAuthSchemes, getConnectionKeepAliveStrategy, getConnectionManager, getConnectionReuseStrategy, getCookieSpecs, getCookieStore, getCredentialsProvider, getHttpProcessor, getHttpRequestRetryHandler, getParams, getProxyAuthenticationHandler, getRedirectHandler, getRequestExecutor, getRequestInterceptor, getRequestInterceptorCount, getResponseInterceptor, getResponseInterceptorCount, getRoutePlanner, getTargetAuthenticationHandler, getUserTokenHandler, removeRequestInterceptorByClass, removeResponseInterceptorByClass, setAuthSchemes, setCookieSpecs, setCookieStore, setCredentialsProvider, setHttpRequestRetryHandler, setKeepAliveStrategy, setParams, setProxyAuthenticationHandler, setRedirectHandler, setReuseStrategy, setRoutePlanner, setTargetAuthenticationHandler, setUserTokenHandler
-
Constructor Details
-
DefaultHttpClient
Creates a new HTTP client from parameters and a connection manager.- Parameters:
params- the parametersconman- the connection manager
-
DefaultHttpClient
-
DefaultHttpClient
public DefaultHttpClient()
-
-
Method Details
-
createHttpParams
- Specified by:
createHttpParamsin classAbstractHttpClient
-
createRequestExecutor
- Specified by:
createRequestExecutorin classAbstractHttpClient
-
createClientConnectionManager
- Specified by:
createClientConnectionManagerin classAbstractHttpClient
-
createHttpContext
- Specified by:
createHttpContextin classAbstractHttpClient
-
createConnectionReuseStrategy
- Specified by:
createConnectionReuseStrategyin classAbstractHttpClient
-
createConnectionKeepAliveStrategy
- Specified by:
createConnectionKeepAliveStrategyin classAbstractHttpClient
-
createAuthSchemeRegistry
- Specified by:
createAuthSchemeRegistryin classAbstractHttpClient
-
createCookieSpecRegistry
- Specified by:
createCookieSpecRegistryin classAbstractHttpClient
-
createHttpProcessor
- Specified by:
createHttpProcessorin classAbstractHttpClient
-
createHttpRequestRetryHandler
- Specified by:
createHttpRequestRetryHandlerin classAbstractHttpClient
-
createRedirectHandler
- Specified by:
createRedirectHandlerin classAbstractHttpClient
-
createTargetAuthenticationHandler
- Specified by:
createTargetAuthenticationHandlerin classAbstractHttpClient
-
createProxyAuthenticationHandler
- Specified by:
createProxyAuthenticationHandlerin classAbstractHttpClient
-
createCookieStore
- Specified by:
createCookieStorein classAbstractHttpClient
-
createCredentialsProvider
- Specified by:
createCredentialsProviderin classAbstractHttpClient
-
createHttpRoutePlanner
- Specified by:
createHttpRoutePlannerin classAbstractHttpClient
-
createUserTokenHandler
- Specified by:
createUserTokenHandlerin classAbstractHttpClient
-