Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.http.params
Class HttpProtocolParams  view HttpProtocolParams download HttpProtocolParams.java

java.lang.Object
  extended byorg.apache.http.params.HttpProtocolParams

public final class HttpProtocolParams
extends java.lang.Object

This class implements an adaptor around the HttpParams interface to simplify manipulation of the HTTP protocol specific parameters.

Since:
4.0
Version:
$Revision: 376961 $

Field Summary
static java.lang.String CREDENTIAL_CHARSET
          Defines the charset to be used when encoding credentials.
static java.lang.String DATE_PATTERNS
          The key used to look up the date patterns used for parsing.
static java.lang.String HTTP_CONTENT_CHARSET
          Defines the charset to be used per default for encoding content body.
static java.lang.String HTTP_ELEMENT_CHARSET
          Defines the charset to be used for encoding HTTP protocol elements.
static java.lang.String ORIGIN_SERVER
          Defines the content of the Server header.
static java.lang.String PROTOCOL_VERSION
          Defines the HTTP protocol version used per default.
static java.lang.String STATUS_LINE_GARBAGE_LIMIT
          Defines the maximum number of ignorable lines before we expect a HTTP response's status code.
static java.lang.String STRICT_TRANSFER_ENCODING
          Defines whether responses with an invalid Transfer-Encoding header should be rejected.
static java.lang.String USE_EXPECT_CONTINUE
           Activates 'Expect: 100-Continue' handshake for the entity enclosing methods.
static java.lang.String USER_AGENT
          Defines the content of the User-Agent header.
static java.lang.String VIRTUAL_HOST
          Defines the virtual host name.
 
Constructor Summary
private HttpProtocolParams()
           
 
Method Summary
static java.lang.String getContentCharset(HttpParams params)
          Returns the default charset to be used for writing content body, when no charset explicitly specified.
static java.lang.String getCredentialCharset(HttpParams params)
          Returns the charset to be used for credentials.
static java.lang.String getHttpElementCharset(HttpParams params)
          Returns the charset to be used for writing HTTP headers.
static java.lang.String getUserAgent(HttpParams params)
           
static org.apache.http.HttpVersion getVersion(HttpParams params)
          Returns HTTP protocol version to be used per default.
static java.lang.String getVirtualHost(HttpParams params)
          Returns the virtual host name.
static void setContentCharset(HttpParams params, java.lang.String charset)
          Sets the default charset to be used for writing content body, when no charset explicitly specified.
static void setCredentialCharset(HttpParams params, java.lang.String charset)
          Sets the charset to be used for writing HTTP headers.
static void setHttpElementCharset(HttpParams params, java.lang.String charset)
          Sets the charset to be used for writing HTTP headers.
static void setUseExpectContinue(HttpParams params, boolean b)
           
static void setUserAgent(HttpParams params, java.lang.String useragent)
           
static void setVersion(HttpParams params, org.apache.http.HttpVersion version)
          Assigns the HTTP protocol version to be used by the HTTP methods that this collection of parameters applies to.
static void setVirtualHost(HttpParams params, java.lang.String hostname)
          Sets the virtual host name.
static boolean useExpectContinue(HttpParams params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL_VERSION

public static final java.lang.String PROTOCOL_VERSION
Defines the HTTP protocol version used per default.

This parameter expects a value of type org.apache.http.HttpVersion.

See Also:
Constant Field Values

CREDENTIAL_CHARSET

public static final java.lang.String CREDENTIAL_CHARSET
Defines the charset to be used when encoding credentials. If not defined then the HTTP_ELEMENT_CHARSET 55 should be used.

This parameter expects a value of type java.lang.String.

See Also:
Constant Field Values

HTTP_ELEMENT_CHARSET

public static final java.lang.String HTTP_ELEMENT_CHARSET
Defines the charset to be used for encoding HTTP protocol elements.

This parameter expects a value of type java.lang.String.

See Also:
Constant Field Values

HTTP_CONTENT_CHARSET

public static final java.lang.String HTTP_CONTENT_CHARSET
Defines the charset to be used per default for encoding content body.

This parameter expects a value of type java.lang.String.

See Also:
Constant Field Values

USER_AGENT

public static final java.lang.String USER_AGENT
Defines the content of the User-Agent header.

This parameter expects a value of type java.lang.String.

See Also:
Constant Field Values

ORIGIN_SERVER

public static final java.lang.String ORIGIN_SERVER
Defines the content of the Server header.

This parameter expects a value of type java.lang.String.

See Also:
Constant Field Values

STATUS_LINE_GARBAGE_LIMIT

public static final java.lang.String STATUS_LINE_GARBAGE_LIMIT
Defines the maximum number of ignorable lines before we expect a HTTP response's status code.

With HTTP/1.1 persistent connections, the problem arises that broken scripts could return a wrong Content-Length (there are more bytes sent than specified).
Unfortunately, in some cases, this is not possible after the bad response, but only before the next one.
So, HttpClient must be able to skip those surplus lines this way.

Set this to 0 to disallow any garbage/empty lines before the status line.
To specify no limit, use Integer.MAX_VALUE>Integer.MAX_VALUE 55 (default in lenient mode).

This parameter expects a value of type java.lang.Integer.

See Also:
Constant Field Values

DATE_PATTERNS

public static final java.lang.String DATE_PATTERNS
The key used to look up the date patterns used for parsing. The String patterns are stored in a java.util.Collection and must be compatible with java.text.SimpleDateFormat.

This parameter expects a value of type java.util.Collection.

See Also:
Constant Field Values

VIRTUAL_HOST

public static final java.lang.String VIRTUAL_HOST
Defines the virtual host name.

This parameter expects a value of type java.lang.String.

See Also:
Constant Field Values

STRICT_TRANSFER_ENCODING

public static final java.lang.String STRICT_TRANSFER_ENCODING
Defines whether responses with an invalid Transfer-Encoding header should be rejected.

This parameter expects a value of type java.lang.Boolean.

See Also:
Constant Field Values

USE_EXPECT_CONTINUE

public static final java.lang.String USE_EXPECT_CONTINUE

Activates 'Expect: 100-Continue' handshake for the entity enclosing methods. The purpose of the 'Expect: 100-Continue' handshake to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.

The use of the 'Expect: 100-continue' handshake can result in noticable peformance improvement for entity enclosing requests (such as POST and PUT) that require the target server's authentication.

'Expect: 100-continue' handshake should be used with caution, as it may cause problems with HTTP servers and proxies that do not support HTTP/1.1 protocol.

This parameter expects a value of type java.lang.Boolean.

See Also:
Constant Field Values
Constructor Detail

HttpProtocolParams

private HttpProtocolParams()
Method Detail

getHttpElementCharset

public static java.lang.String getHttpElementCharset(HttpParams params)
Returns the charset to be used for writing HTTP headers.


setHttpElementCharset

public static void setHttpElementCharset(HttpParams params,
                                         java.lang.String charset)
Sets the charset to be used for writing HTTP headers.


getContentCharset

public static java.lang.String getContentCharset(HttpParams params)
Returns the default charset to be used for writing content body, when no charset explicitly specified.


setContentCharset

public static void setContentCharset(HttpParams params,
                                     java.lang.String charset)
Sets the default charset to be used for writing content body, when no charset explicitly specified.


getCredentialCharset

public static java.lang.String getCredentialCharset(HttpParams params)
Returns the charset to be used for credentials. If not configured the HTTP element charset 55 is used.


setCredentialCharset

public static void setCredentialCharset(HttpParams params,
                                        java.lang.String charset)
Sets the charset to be used for writing HTTP headers.


getVersion

public static org.apache.http.HttpVersion getVersion(HttpParams params)
Returns HTTP protocol version to be used per default.


setVersion

public static void setVersion(HttpParams params,
                              org.apache.http.HttpVersion version)
Assigns the HTTP protocol version to be used by the HTTP methods that this collection of parameters applies to.


setVirtualHost

public static void setVirtualHost(HttpParams params,
                                  java.lang.String hostname)
Sets the virtual host name.


getVirtualHost

public static java.lang.String getVirtualHost(HttpParams params)
Returns the virtual host name.


getUserAgent

public static java.lang.String getUserAgent(HttpParams params)

setUserAgent

public static void setUserAgent(HttpParams params,
                                java.lang.String useragent)

useExpectContinue

public static boolean useExpectContinue(HttpParams params)

setUseExpectContinue

public static void setUseExpectContinue(HttpParams params,
                                        boolean b)