|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.httpclient.params.DefaultHttpParams
com.microsoft.tfs.core.httpclient.params.HttpMethodParams
public class HttpMethodParams
This class represents a collection of HTTP protocol parameters applicable to
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.
Field Summary | |
---|---|
static java.lang.String |
BUFFER_WARN_TRIGGER_LIMIT
Sets the maximum buffered response size (in bytes) that triggers no warning. |
static java.lang.String |
COOKIE_POLICY
Defines cookie policy to be used for cookie
management. |
static java.lang.String |
CREDENTIAL_CHARSET
Defines the charset to be used when encoding Credentials . |
static java.lang.String |
DATE_PATTERNS
The key used to look up the date patterns used for parsing. |
static java.lang.String |
HEAD_BODY_CHECK_TIMEOUT
Sets period of time in milliseconds to wait for a content body sent in response to HEAD
method from a non-compliant server. |
static java.lang.String |
HTTP_CONTENT_CHARSET
Defines the charset to be used 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 |
HTTP_URI_CHARSET
Defines the charset to be used for parsing URIs. |
static java.lang.String |
MULTIPART_BOUNDARY
Sets the value to use as the multipart boundary. |
static java.lang.String |
PROTOCOL_VERSION
Defines the HTTP protocol version used by
HTTP methods per
default. |
static java.lang.String |
REJECT_HEAD_BODY
Defines whether the content body sent in response to HeadMethod should be
rejected. |
static java.lang.String |
RETRY_HANDLER
Sets the method retry handler parameter. |
static java.lang.String |
SINGLE_COOKIE_HEADER
Defines whether cookies
should be put on a single response header . |
static java.lang.String |
SO_TIMEOUT
Sets the socket timeout (SO_TIMEOUT) in milliseconds to be used when executing the method. |
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 |
UNAMBIGUOUS_STATUS_LINE
Defines whether HTTP
methods should reject ambiguous
HTTP status line . |
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 used by HTTP methods . |
static java.lang.String |
VIRTUAL_HOST
Defines the virtual host name. |
static java.lang.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 DefaultHttpParams.getDefaultParams() as a parent. |
|
HttpMethodParams(HttpParams defaults)
Creates a new collection of parameters with the given parent. |
Method Summary | |
---|---|
java.lang.String |
getContentCharset()
Returns the default charset to be used for writing content body, when no charset explicitly specified. |
java.lang.String |
getCookiePolicy()
Returns cookie policy to be used by the
HTTP methods this
collection of parameters applies to. |
java.lang.String |
getCredentialCharset()
Returns the charset to be used for Credentials . |
java.lang.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. |
java.lang.String |
getUriCharset()
Returns the charset to be used for parsing URIs. |
HttpVersion |
getVersion()
Returns HTTP protocol version to be used by the
HTTP methods that this
collection of parameters applies to. |
java.lang.String |
getVirtualHost()
Returns the virtual host name. |
void |
makeLenient()
Makes the 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 HTTP methods
strictly follow the HTTP protocol specification (RFC 2616 and other
relevant RFCs). |
void |
setContentCharset(java.lang.String charset)
Sets the default charset to be used for writing content body, when no charset explicitly specified. |
void |
setCookiePolicy(java.lang.String policy)
Assigns the cookie policy to be used by the
HTTP methods this
collection of parameters applies to. |
void |
setCredentialCharset(java.lang.String charset)
Sets the charset to be used for writing HTTP headers. |
void |
setHttpElementCharset(java.lang.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 |
setUriCharset(java.lang.String charset)
Sets the charset to be used for parsing URIs. |
void |
setVersion(HttpVersion version)
Assigns the HTTP protocol version to be used by the
HTTP methods that this
collection of parameters applies to. |
void |
setVirtualHost(java.lang.String hostname)
Sets the virtual host name. |
Methods inherited from class com.microsoft.tfs.core.httpclient.params.DefaultHttpParams |
---|
clear, clone, getBooleanParameter, getDefaultParams, getDefaults, getDoubleParameter, getIntParameter, getLongParameter, getParameter, isParameterFalse, isParameterSet, isParameterSetLocally, isParameterTrue, setBooleanParameter, setDefaults, setDoubleParameter, setHttpParamsFactory, setIntParameter, setLongParameter, setParameter, setParameters |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USER_AGENT
HTTP methods
.
This parameter expects a value of type String
.
"http.useragent"
public static final java.lang.String PROTOCOL_VERSION
HTTP protocol version
used by
HTTP methods
per
default.
This parameter expects a value of type HttpVersion
.
"http.protocol.version"
public static final java.lang.String UNAMBIGUOUS_STATUS_LINE
HTTP
methods
should reject ambiguous
HTTP status line
.
This parameter expects a value of type Boolean
.
"http.protocol.unambiguous-statusline"
public static final java.lang.String SINGLE_COOKIE_HEADER
cookies
should be put on a single response header
.
This parameter expects a value of type Boolean
.
"http.protocol.single-cookie-header"
public static final java.lang.String STRICT_TRANSFER_ENCODING
This parameter expects a value of type Boolean
.
"http.protocol.strict-transfer-encoding"
public static final java.lang.String REJECT_HEAD_BODY
HeadMethod
should be
rejected.
This parameter expects a value of type Boolean
.
"http.protocol.reject-head-body"
public static final java.lang.String HEAD_BODY_CHECK_TIMEOUT
HEAD
method
from a non-compliant server. If the parameter is not set or set
to -1 non-compliant response body check is disabled.
This parameter expects a value of type Integer
.
"http.protocol.head-body-timeout"
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
.
"http.protocol.expect-continue"
public static final java.lang.String CREDENTIAL_CHARSET
Credentials
. If not defined then
the HTTP_ELEMENT_CHARSET
should be used.
This parameter expects a value of type String
.
"http.protocol.credential-charset"
public static final java.lang.String HTTP_ELEMENT_CHARSET
This parameter expects a value of type String
.
"http.protocol.element-charset"
public static final java.lang.String HTTP_URI_CHARSET
This parameter expects a value of type String
.
"http.protocol.uri-charset"
public static final java.lang.String HTTP_CONTENT_CHARSET
This parameter expects a value of type String
.
"http.protocol.content-charset"
public static final java.lang.String COOKIE_POLICY
cookie policy
to be used for cookie
management.
This parameter expects a value of type String
.
"http.protocol.cookie-policy"
public static final java.lang.String WARN_EXTRA_INPUT
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 Boolean
.
"http.protocol.warn-extra-input"
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
.
"http.protocol.status-line-garbage-limit"
public static final java.lang.String SO_TIMEOUT
This parameter expects a value of type Integer
.
"http.socket.timeout"
SocketOptions.SO_TIMEOUT
,
Constant Field Valuespublic static final java.lang.String DATE_PATTERNS
Collection
and must be
compatible with SimpleDateFormat
.
This parameter expects a value of type Collection
.
"http.dateparser.patterns"
public static final java.lang.String RETRY_HANDLER
This parameter expects a value of type
HttpMethodRetryHandler
.
"http.method.retry-handler"
public static final java.lang.String BUFFER_WARN_TRIGGER_LIMIT
This parameter expects a value if type Integer
.
"http.method.response.buffer.warnlimit"
public static final java.lang.String VIRTUAL_HOST
This parameter expects a value of type String
.
"http.virtual-host"
public static final java.lang.String MULTIPART_BOUNDARY
This parameter expects a value if type String
.
"http.method.multipart.boundary"
MultipartRequestEntity
,
Constant Field ValuesConstructor Detail |
---|
public HttpMethodParams()
DefaultHttpParams.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.
DefaultHttpParams.getDefaultParams()
public HttpMethodParams(HttpParams defaults)
defaults
- the parent collection to defer to, if a parameter is not explictly
set in the collection itself.DefaultHttpParams.getDefaultParams()
Method Detail |
---|
public java.lang.String getHttpElementCharset()
public void setHttpElementCharset(java.lang.String charset)
charset
- The charsetpublic java.lang.String getContentCharset()
public void setUriCharset(java.lang.String charset)
charset
- The charsetpublic java.lang.String getUriCharset()
public void setContentCharset(java.lang.String charset)
charset
- The charsetpublic java.lang.String getCredentialCharset()
Credentials
. If not configured the
HTTP element charset
is used.
public void setCredentialCharset(java.lang.String charset)
charset
- The charsetpublic HttpVersion getVersion()
HTTP protocol version
to be used by the
HTTP methods
that this
collection of parameters applies to.
HTTP protocol version
public void setVersion(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 java.lang.String getCookiePolicy()
cookie policy
to be used by the
HTTP methods
this
collection of parameters applies to.
cookie policy
public void setCookiePolicy(java.lang.String policy)
cookie policy
to be used by the
HTTP methods
this
collection of parameters applies to.
policy
- the cookie policy
public int getSoTimeout()
public void setSoTimeout(int timeout)
timeout
- Timeout in millisecondspublic void setVirtualHost(java.lang.String hostname)
hostname
- The host namepublic java.lang.String getVirtualHost()
public void makeStrict()
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 makeLenient()
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).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |