|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.params.HttpProtocolParams
This class implements an adaptor around the HttpParams
interface
to simplify manipulation of the HTTP protocol specific parameters.
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 |
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 |
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 |
public static final java.lang.String PROTOCOL_VERSION
HTTP protocol version
used per default.
This parameter expects a value of type HttpVersion
.
public static final java.lang.String HTTP_ELEMENT_CHARSET
This parameter expects a value of type String
.
public static final java.lang.String HTTP_CONTENT_CHARSET
This parameter expects a value of type String
.
public static final java.lang.String USER_AGENT
This parameter expects a value of type String
.
public static final java.lang.String ORIGIN_SERVER
This parameter expects a value of type String
.
public static final java.lang.String STATUS_LINE_GARBAGE_LIMIT
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
(default in lenient mode).
Integer
.
public static final java.lang.String STRICT_TRANSFER_ENCODING
This parameter expects a value of type Boolean
.
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 typeBoolean
.
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 typeInteger
.
Method Detail |
public static java.lang.String getHttpElementCharset(HttpParams params)
public static void setHttpElementCharset(HttpParams params, java.lang.String charset)
charset
- The charsetpublic static java.lang.String getContentCharset(HttpParams params)
public static void setContentCharset(HttpParams params, java.lang.String charset)
charset
- The charsetpublic static HttpVersion getVersion(HttpParams params)
HTTP protocol version
to be used per default.
HTTP protocol version
public static void setVersion(HttpParams params, HttpVersion version)
HTTP protocol version
to be used by the
HTTP methods that this collection of parameters applies to.
version
- the HTTP protocol version
public static java.lang.String getUserAgent(HttpParams params)
public static void setUserAgent(HttpParams params, java.lang.String useragent)
public static boolean useExpectContinue(HttpParams params)
public static void setUseExpectContinue(HttpParams params, boolean b)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |