public class

DefaultHttpClient

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

Class Overview

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:

  • 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:

Summary

Public Constructors
DefaultHttpClient(ClientConnectionManager conman, HttpParams params)
Creates a new HTTP client from parameters and a connection manager.
DefaultHttpClient(ClientConnectionManager conman)
DefaultHttpClient(HttpParams params)
DefaultHttpClient()
Public Methods
static void setDefaultHttpParams(HttpParams params)
Saves the default set of HttpParams in the provided parameter.
Protected Methods
HttpParams createHttpParams()
Creates the default set of HttpParams by invoking setDefaultHttpParams(HttpParams)
BasicHttpProcessor createHttpProcessor()
[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)

Also: HttpClient

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

Parameters
conman the connection manager
params the parameters

public DefaultHttpClient (ClientConnectionManager conman)

Also: HttpClient

public DefaultHttpClient (HttpParams params)

Also: HttpClient

public DefaultHttpClient ()

Also: HttpClient

Public Methods

public static void setDefaultHttpParams (HttpParams params)

Also: HttpClient

Saves the default set of HttpParams in the provided parameter. These are:

Protected Methods

protected HttpParams createHttpParams ()

Also: HttpClient

Creates the default set of HttpParams by invoking setDefaultHttpParams(HttpParams)

Returns
  • a new instance of SyncBasicHttpParams with the defaults applied to it.

protected BasicHttpProcessor createHttpProcessor ()

Also: HttpClient