to top
Android APIs
public class

DefaultHttpClient

extends AbstractHttpClient
java.lang.Object
   ↳ org.apache.http.impl.client.AbstractHttpClient
     ↳ org.apache.http.impl.client.DefaultHttpClient

Class Overview

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.

Summary

Public Constructors
DefaultHttpClient(ClientConnectionManager conman, HttpParams params)
Creates a new HTTP client from parameters and a connection manager.
DefaultHttpClient(HttpParams params)
DefaultHttpClient()
Protected Methods
AuthSchemeRegistry createAuthSchemeRegistry()
ClientConnectionManager createClientConnectionManager()
ConnectionKeepAliveStrategy createConnectionKeepAliveStrategy()
ConnectionReuseStrategy createConnectionReuseStrategy()
CookieSpecRegistry createCookieSpecRegistry()
CookieStore createCookieStore()
CredentialsProvider createCredentialsProvider()
HttpContext createHttpContext()
HttpParams createHttpParams()
BasicHttpProcessor createHttpProcessor()
HttpRequestRetryHandler createHttpRequestRetryHandler()
HttpRoutePlanner createHttpRoutePlanner()
AuthenticationHandler createProxyAuthenticationHandler()
RedirectHandler createRedirectHandler()
HttpRequestExecutor createRequestExecutor()
AuthenticationHandler createTargetAuthenticationHandler()
UserTokenHandler createUserTokenHandler()
[Expand]
Inherited Methods
From class org.apache.http.impl.client.AbstractHttpClient
From class java.lang.Object
From interface org.apache.http.client.HttpClient

Public Constructors

public DefaultHttpClient (ClientConnectionManager conman, HttpParams params)

Since: API Level 1

Creates a new HTTP client from parameters and a connection manager.

Parameters
conman the connection manager
params the parameters

public DefaultHttpClient (HttpParams params)

Since: API Level 1

public DefaultHttpClient ()

Since: API Level 1

Protected Methods

protected AuthSchemeRegistry createAuthSchemeRegistry ()

Since: API Level 1

protected ClientConnectionManager createClientConnectionManager ()

Since: API Level 1

protected ConnectionKeepAliveStrategy createConnectionKeepAliveStrategy ()

Since: API Level 1

protected ConnectionReuseStrategy createConnectionReuseStrategy ()

Since: API Level 1

protected CookieSpecRegistry createCookieSpecRegistry ()

Since: API Level 1

protected CookieStore createCookieStore ()

Since: API Level 1

protected CredentialsProvider createCredentialsProvider ()

Since: API Level 1

protected HttpContext createHttpContext ()

Since: API Level 1

protected HttpParams createHttpParams ()

Since: API Level 1

protected BasicHttpProcessor createHttpProcessor ()

Since: API Level 1

protected HttpRequestRetryHandler createHttpRequestRetryHandler ()

Since: API Level 1

protected HttpRoutePlanner createHttpRoutePlanner ()

Since: API Level 1

protected AuthenticationHandler createProxyAuthenticationHandler ()

Since: API Level 1

protected RedirectHandler createRedirectHandler ()

Since: API Level 1

protected HttpRequestExecutor createRequestExecutor ()

Since: API Level 1

protected AuthenticationHandler createTargetAuthenticationHandler ()

Since: API Level 1

protected UserTokenHandler createUserTokenHandler ()

Since: API Level 1