org.apache.http.params
Class HttpProtocolParams

java.lang.Object
  extended by org.apache.http.params.HttpProtocolParams
All Implemented Interfaces:
CoreProtocolPNames

public final class HttpProtocolParams
extends java.lang.Object
implements CoreProtocolPNames

Utility class for accessing protocol parameters in HttpParams.

Since:
4.0
See Also:
CoreProtocolPNames

Field Summary
 
Fields inherited from interface org.apache.http.params.CoreProtocolPNames
HTTP_CONTENT_CHARSET, HTTP_ELEMENT_CHARSET, ORIGIN_SERVER, PROTOCOL_VERSION, STRICT_TRANSFER_ENCODING, USE_EXPECT_CONTINUE, USER_AGENT, WAIT_FOR_CONTINUE
 
Method Summary
static java.lang.String getContentCharset(HttpParams params)
          Obtains value of the CoreProtocolPNames.HTTP_CONTENT_CHARSET parameter.
static java.lang.String getHttpElementCharset(HttpParams params)
          Obtains value of the CoreProtocolPNames.HTTP_ELEMENT_CHARSET parameter.
static java.lang.String getUserAgent(HttpParams params)
          Obtains value of the CoreProtocolPNames.USER_AGENT parameter.
static ProtocolVersion getVersion(HttpParams params)
          Obtains value of the CoreProtocolPNames.PROTOCOL_VERSION parameter.
static void setContentCharset(HttpParams params, java.lang.String charset)
          Sets value of the CoreProtocolPNames.HTTP_CONTENT_CHARSET parameter.
static void setHttpElementCharset(HttpParams params, java.lang.String charset)
          Sets value of the CoreProtocolPNames.HTTP_ELEMENT_CHARSET parameter.
static void setUseExpectContinue(HttpParams params, boolean b)
          Sets value of the CoreProtocolPNames.USE_EXPECT_CONTINUE parameter.
static void setUserAgent(HttpParams params, java.lang.String useragent)
          Sets value of the CoreProtocolPNames.USER_AGENT parameter.
static void setVersion(HttpParams params, ProtocolVersion version)
          Sets value of the CoreProtocolPNames.PROTOCOL_VERSION parameter.
static boolean useExpectContinue(HttpParams params)
          Obtains value of the CoreProtocolPNames.USE_EXPECT_CONTINUE parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHttpElementCharset

public static java.lang.String getHttpElementCharset(HttpParams params)
Obtains value of the CoreProtocolPNames.HTTP_ELEMENT_CHARSET parameter. If not set, defaults to US-ASCII.

Parameters:
params - HTTP parameters.
Returns:
HTTP element charset.

setHttpElementCharset

public static void setHttpElementCharset(HttpParams params,
                                         java.lang.String charset)
Sets value of the CoreProtocolPNames.HTTP_ELEMENT_CHARSET parameter.

Parameters:
params - HTTP parameters.
charset - HTTP element charset.

getContentCharset

public static java.lang.String getContentCharset(HttpParams params)
Obtains value of the CoreProtocolPNames.HTTP_CONTENT_CHARSET parameter. If not set, defaults to ISO-8859-1.

Parameters:
params - HTTP parameters.
Returns:
HTTP content charset.

setContentCharset

public static void setContentCharset(HttpParams params,
                                     java.lang.String charset)
Sets value of the CoreProtocolPNames.HTTP_CONTENT_CHARSET parameter.

Parameters:
params - HTTP parameters.
charset - HTTP content charset.

getVersion

public static ProtocolVersion getVersion(HttpParams params)
Obtains value of the CoreProtocolPNames.PROTOCOL_VERSION parameter. If not set, defaults to HttpVersion.HTTP_1_1.

Parameters:
params - HTTP parameters.
Returns:
HTTP protocol version.

setVersion

public static void setVersion(HttpParams params,
                              ProtocolVersion version)
Sets value of the CoreProtocolPNames.PROTOCOL_VERSION parameter.

Parameters:
params - HTTP parameters.
version - HTTP protocol version.

getUserAgent

public static java.lang.String getUserAgent(HttpParams params)
Obtains value of the CoreProtocolPNames.USER_AGENT parameter. If not set, returns null.

Parameters:
params - HTTP parameters.
Returns:
User agent string.

setUserAgent

public static void setUserAgent(HttpParams params,
                                java.lang.String useragent)
Sets value of the CoreProtocolPNames.USER_AGENT parameter.

Parameters:
params - HTTP parameters.
useragent - User agent string.

useExpectContinue

public static boolean useExpectContinue(HttpParams params)
Obtains value of the CoreProtocolPNames.USE_EXPECT_CONTINUE parameter. If not set, returns false.

Parameters:
params - HTTP parameters.
Returns:
User agent string.

setUseExpectContinue

public static void setUseExpectContinue(HttpParams params,
                                        boolean b)
Sets value of the CoreProtocolPNames.USE_EXPECT_CONTINUE parameter.

Parameters:
params - HTTP parameters.
b - expect-continue flag.


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.