org.apache.commons.httpclient.params
public class HttpMethodParams extends DefaultHttpParams
Since: 3.0
Version: $Revision: 354155 $
Field Summary | |
---|---|
static String | BUFFER_WARN_TRIGGER_LIMIT
Sets the maximum buffered response size (in bytes) that triggers no warning. |
static String | COOKIE_POLICY
Defines {@link CookiePolicy cookie policy} to be used for cookie management.
|
static String | CREDENTIAL_CHARSET
Defines the charset to be used when encoding
{@link org.apache.commons.httpclient.Credentials}. |
static String | DATE_PATTERNS
The key used to look up the date patterns used for parsing. |
static String | HEAD_BODY_CHECK_TIMEOUT
Sets period of time in milliseconds to wait for a content body sent in response to
{@link org.apache.commons.httpclient.methods.HeadMethod HEAD method} from a
non-compliant server. |
static String | HTTP_CONTENT_CHARSET
Defines the charset to be used for encoding content body.
|
static String | HTTP_ELEMENT_CHARSET
Defines the charset to be used for encoding HTTP protocol elements.
|
static String | MULTIPART_BOUNDARY
Sets the value to use as the multipart boundary.
|
static String | PROTOCOL_VERSION
Defines the {@link HttpVersion HTTP protocol version} used by
{@link org.apache.commons.httpclient.HttpMethod HTTP methods} per
default.
|
static String | REJECT_HEAD_BODY
Defines whether the content body sent in response to
{@link org.apache.commons.httpclient.methods.HeadMethod} should be rejected.
|
static String | RETRY_HANDLER
Sets the method retry handler parameter.
|
static String | SINGLE_COOKIE_HEADER
Defines whether {@link org.apache.commons.httpclient.Cookie cookies} should be put on
a single {@link org.apache.commons.httpclient.Header response header}.
|
static String | SO_TIMEOUT
Sets the socket timeout (SO_TIMEOUT) in milliseconds to be used when executing the method.
|
static String | STATUS_LINE_GARBAGE_LIMIT
Defines the maximum number of ignorable lines before we expect
a HTTP response's status code.
|
static String | STRICT_TRANSFER_ENCODING
Defines whether responses with an invalid Transfer-Encoding header should be
rejected.
|
static String | UNAMBIGUOUS_STATUS_LINE
Defines whether {@link org.apache.commons.httpclient.HttpMethod HTTP methods} should
reject ambiguous {@link org.apache.commons.httpclient.StatusLine HTTP status line}.
|
static String | USER_AGENT
Defines the content of the User-Agent header used by
{@link org.apache.commons.httpclient.HttpMethod HTTP methods}.
|
static String | USE_EXPECT_CONTINUE Activates 'Expect: 100-Continue' handshake for the {@link org.apache.commons.httpclient.methods.ExpectContinueMethod entity enclosing methods}. |
static String | VIRTUAL_HOST
Defines the virtual host name.
|
static String | WARN_EXTRA_INPUT
Defines HttpClient's behavior when a response provides more bytes than
expected (specified with Content-Length, for example).
|
Constructor Summary | |
---|---|
HttpMethodParams()
Creates a new collection of parameters with the collection returned
by {@link #getDefaultParams()} as a parent. | |
HttpMethodParams(HttpParams defaults)
Creates a new collection of parameters with the given parent.
|
Method Summary | |
---|---|
String | getContentCharset()
Returns the default charset to be used for writing content body,
when no charset explicitly specified. |
String | getCookiePolicy()
Returns {@link CookiePolicy cookie policy} to be used by the
{@link org.apache.commons.httpclient.HttpMethod HTTP methods}
this collection of parameters applies to.
|
String | getCredentialCharset()
Returns the charset to be used for {@link org.apache.commons.httpclient.Credentials}. |
String | getHttpElementCharset()
Returns the charset to be used for writing HTTP headers. |
int | getSoTimeout()
Returns the default socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. |
HttpVersion | getVersion()
Returns {@link HttpVersion HTTP protocol version} to be used by the
{@link org.apache.commons.httpclient.HttpMethod HTTP methods} that
this collection of parameters applies to.
|
String | getVirtualHost()
Returns the virtual host name.
|
void | makeLenient()
Makes the {@link 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). |
void | makeStrict()
Makes the {@link org.apache.commons.httpclient.HttpMethod HTTP methods}
strictly follow the HTTP protocol specification (RFC 2616 and other relevant RFCs).
|
void | setContentCharset(String charset)
Sets the default charset to be used for writing content body,
when no charset explicitly specified. |
void | setCookiePolicy(String policy)
Assigns the {@link CookiePolicy cookie policy} to be used by the
{@link org.apache.commons.httpclient.HttpMethod HTTP methods}
this collection of parameters applies to.
|
void | setCredentialCharset(String charset)
Sets the charset to be used for writing HTTP headers. |
void | setHttpElementCharset(String charset)
Sets the charset to be used for writing HTTP headers. |
void | setSoTimeout(int timeout)
Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. |
void | setVersion(HttpVersion version)
Assigns the {@link HttpVersion HTTP protocol version} to be used by the
{@link org.apache.commons.httpclient.HttpMethod HTTP methods} that
this collection of parameters applies to.
|
void | setVirtualHost(String hostname)
Sets the virtual host name.
|
This parameter expects a value if type {@link Integer}.
This parameter expects a value of type {@link String}.
This parameter expects a value of type {@link String}.
This parameter expects a value of type {@link java.util.Collection}.
This parameter expects a value of type {@link Integer}.
This parameter expects a value of type {@link String}.
This parameter expects a value of type {@link String}.
This parameter expects a value if type {@link String}.
See Also: MultipartRequestEntity
This parameter expects a value of type {@link HttpVersion}.
This parameter expects a value of type {@link Boolean}.
This parameter expects a value of type {@link org.apache.commons.httpclient.HttpMethodRetryHandler}.
This parameter expects a value of type {@link Boolean}.
This parameter expects a value of type {@link Integer}.
See Also: java.net.SocketOptions#SO_TIMEOUT
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 {@link java.lang.Integer#MAX_VALUE} (default in lenient mode).
This parameter expects a value of type {@link Boolean}.
This parameter expects a value of type {@link Boolean}.
This parameter expects a value of type {@link String}.
Activates 'Expect: 100-Continue' handshake for the {@link 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.
This parameter expects a value of type {@link Boolean}.This parameter expects a value of type {@link java.lang.String}.
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.
This parameter expects a value of type {@link Boolean}.
See Also: HttpMethodParams
Parameters: defaults the parent collection to defer to, if a parameter is not explictly set in the collection itself.
See Also: HttpMethodParams
Returns: The charset
Returns: {@link CookiePolicy cookie policy}
Returns: The charset
Returns: The charset
Returns: timeout in milliseconds
Returns: {@link HttpVersion HTTP protocol version}
Returns: The virtual host name
Parameters: charset The charset
Parameters: policy the {@link CookiePolicy cookie policy}
Parameters: charset The charset
Parameters: charset The charset
Parameters: timeout Timeout in milliseconds
Parameters: version the {@link HttpVersion HTTP protocol version}
Parameters: hostname The host name