This class represents a collection of HTTP protocol parameters applicable to
org.apache.commons.httpclient.HttpMethod HTTP methods . Protocol
parameters may be linked together to form a hierarchy. If a particular
parameter value has not been explicitly defined in the collection itself,
its value will be drawn from the parent collection of parameters.
author: Oleg Kalnichevski author: Christian Kohlschuetter version: $Revision: 483949 $ since: 3.0
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.
makeLenient() Makes the
org.apache.commons.httpclient.HttpMethod HTTP methods attempt to mimic the exact behaviour of commonly used HTTP agents,
which many HTTP servers expect, even though such behaviour may violate
the HTTP protocol specification (RFC 2616 and other relevant RFCs).
public void
makeStrict() Makes the
org.apache.commons.httpclient.HttpMethod HTTP methods
strictly follow the HTTP protocol specification (RFC 2616 and other relevant RFCs).
It must be noted that popular HTTP agents have different degree of HTTP protocol
compliance and some HTTP serves are programmed to expect the behaviour that does not
strictly adhere to the HTTP specification.
public void
setContentCharset(String charset) Sets the default charset to be used for writing content body,
when no charset explicitly specified.
final public static String HEAD_BODY_CHECK_TIMEOUT(Code)
Sets period of time in milliseconds to wait for a content body sent in response to
org.apache.commons.httpclient.methods.HeadMethod HEAD method from a
non-compliant server. If the parameter is not set or set to -1 non-compliant
response body check is disabled.
Sets the socket timeout (SO_TIMEOUT) in milliseconds to be used when executing the method.
A timeout value of zero is interpreted as an infinite timeout.
final public static String STATUS_LINE_GARBAGE_LIMIT(Code)
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
java.lang.Integer.MAX_VALUE (default in lenient mode).
final public static String USE_EXPECT_CONTINUE(Code)
Activates 'Expect: 100-Continue' handshake for the
org.apache.commons.httpclient.methods.ExpectContinueMethod 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.
Defines HttpClient's behavior when a response provides more bytes than
expected (specified with Content-Length, for example).
Such surplus data makes the HTTP connection unreliable for keep-alive
requests, as malicious response data (faked headers etc.) can lead to undesired
results on the next request using that connection.
If this parameter is set to true, any detection of extra
input data will generate a warning in the log.
Creates a new collection of parameters with the collection returned
by
HttpMethodParams.getDefaultParams() as a parent. The collection will defer
to its parent for a default value if a particular parameter is not
explicitly set in the collection itself.
See Also:HttpMethodParams.getDefaultParams()
Creates a new collection of parameters with the given parent.
The collection will defer to its parent for a default value
if a particular parameter is not explicitly set in the collection
itself.
Parameters: defaults - the parent collection to defer to, if a parameteris not explictly set in the collection itself. See Also:HttpMethodParams.getDefaultParams()
Returns the default socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. A timeout value of zero is interpreted as an infinite
timeout.
timeout in milliseconds
Makes the
org.apache.commons.httpclient.HttpMethod HTTP methods attempt to mimic the exact behaviour of commonly used HTTP agents,
which many HTTP servers expect, even though such behaviour may violate
the HTTP protocol specification (RFC 2616 and other relevant RFCs).
Makes the
org.apache.commons.httpclient.HttpMethod HTTP methods
strictly follow the HTTP protocol specification (RFC 2616 and other relevant RFCs).
It must be noted that popular HTTP agents have different degree of HTTP protocol
compliance and some HTTP serves are programmed to expect the behaviour that does not
strictly adhere to the HTTP specification.
setContentCharset
public void setContentCharset(String charset)(Code)
Sets the default charset to be used for writing content body,
when no charset explicitly specified.
Parameters: charset - The charset
Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. A timeout value of zero is interpreted as an infinite
timeout.
Parameters: timeout - Timeout in milliseconds