public final class

HttpProtocolParams

extends Object
implements CoreProtocolPNames
java.lang.Object
   ↳ org.apache.http.params.HttpProtocolParams

Class Overview

Utility class for accessing protocol parameters in HttpParams.

Summary

[Expand]
Inherited Constants
From interface org.apache.http.params.CoreProtocolPNames
Public Methods
static String getContentCharset(HttpParams params)
Obtains value of the HTTP_CONTENT_CHARSET parameter.
static String getHttpElementCharset(HttpParams params)
Obtains value of the HTTP_ELEMENT_CHARSET parameter.
static String getUserAgent(HttpParams params)
Obtains value of the USER_AGENT parameter.
static ProtocolVersion getVersion(HttpParams params)
Obtains value of the PROTOCOL_VERSION parameter.
static void setContentCharset(HttpParams params, String charset)
Sets value of the HTTP_CONTENT_CHARSET parameter.
static void setHttpElementCharset(HttpParams params, String charset)
Sets value of the HTTP_ELEMENT_CHARSET parameter.
static void setUseExpectContinue(HttpParams params, boolean b)
Sets value of the USE_EXPECT_CONTINUE parameter.
static void setUserAgent(HttpParams params, String useragent)
Sets value of the USER_AGENT parameter.
static void setVersion(HttpParams params, ProtocolVersion version)
Sets value of the PROTOCOL_VERSION parameter.
static boolean useExpectContinue(HttpParams params)
Obtains value of the USE_EXPECT_CONTINUE parameter.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String getContentCharset (HttpParams params)

Obtains value of the HTTP_CONTENT_CHARSET parameter. If not set, defaults to ISO-8859-1.

Parameters
params HTTP parameters.
Returns
  • HTTP content charset.

public static String getHttpElementCharset (HttpParams params)

Obtains value of the HTTP_ELEMENT_CHARSET parameter. If not set, defaults to US-ASCII.

Parameters
params HTTP parameters.
Returns
  • HTTP element charset.

public static String getUserAgent (HttpParams params)

Obtains value of the USER_AGENT parameter. If not set, returns null.

Parameters
params HTTP parameters.
Returns
  • User agent string.

public static ProtocolVersion getVersion (HttpParams params)

Obtains value of the PROTOCOL_VERSION parameter. If not set, defaults to HTTP_1_1.

Parameters
params HTTP parameters.
Returns
  • HTTP protocol version.

public static void setContentCharset (HttpParams params, String charset)

Sets value of the HTTP_CONTENT_CHARSET parameter.

Parameters
params HTTP parameters.
charset HTTP content charset.

public static void setHttpElementCharset (HttpParams params, String charset)

Sets value of the HTTP_ELEMENT_CHARSET parameter.

Parameters
params HTTP parameters.
charset HTTP element charset.

public static void setUseExpectContinue (HttpParams params, boolean b)

Sets value of the USE_EXPECT_CONTINUE parameter.

Parameters
params HTTP parameters.
b expect-continue flag.

public static void setUserAgent (HttpParams params, String useragent)

Sets value of the USER_AGENT parameter.

Parameters
params HTTP parameters.
useragent User agent string.

public static void setVersion (HttpParams params, ProtocolVersion version)

Sets value of the PROTOCOL_VERSION parameter.

Parameters
params HTTP parameters.
version HTTP protocol version.

public static boolean useExpectContinue (HttpParams params)

Obtains value of the USE_EXPECT_CONTINUE parameter. If not set, returns false.

Parameters
params HTTP parameters.
Returns
  • User agent string.