org.apache.http.params
Class HttpProtocolParams

java.lang.Object
  extended by org.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: 541979 $
Author:
Oleg Kalnichevski

Field Summary
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 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 WAIT_FOR_CONTINUE
           Defines the maximum period of time in milliseconds the client should spend waiting for a 100-continue response.
 
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 getHttpElementCharset(HttpParams params)
          Returns the charset to be used for writing HTTP headers.
static java.lang.String getUserAgent(HttpParams params)
           
static HttpVersion getVersion(HttpParams params)
          Returns HTTP protocol version to be used per default.
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 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, HttpVersion version)
          Assigns the HTTP protocol version to be used by the HTTP methods that this collection of parameters applies to.
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 HttpVersion.

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 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 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 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 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 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 Boolean.

See Also:
Constant Field Values

WAIT_FOR_CONTINUE

public static final java.lang.String WAIT_FOR_CONTINUE

Defines the maximum period of time in milliseconds the client should spend waiting for a 100-continue response.

This parameter expects a value of type Integer.

See Also:
Constant Field Values
Method Detail

getHttpElementCharset

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

Returns:
The charset

setHttpElementCharset

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

Parameters:
charset - The charset

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.

Returns:
The charset

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.

Parameters:
charset - The charset

getVersion

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

Returns:
HTTP protocol version

setVersion

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

Parameters:
version - the HTTP protocol version

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)


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.