Class HttpMethodParams
- java.lang.Object
-
- org.apache.commons.httpclient.params.DefaultHttpParams
-
- org.apache.commons.httpclient.params.HttpMethodParams
-
- All Implemented Interfaces:
Serializable
,Cloneable
,HttpParams
- Direct Known Subclasses:
HttpClientParams
@Deprecated public class HttpMethodParams extends DefaultHttpParams
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.This class represents a collection of HTTP protocol parameters applicable toHTTP 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.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
BUFFER_WARN_TRIGGER_LIMIT
Deprecated.Sets the maximum buffered response size (in bytes) that triggers no warning.static String
COOKIE_POLICY
Deprecated.Definescookie policy
to be used for cookie management.static String
CREDENTIAL_CHARSET
Deprecated.Defines the charset to be used when encodingCredentials
.static String
DATE_PATTERNS
Deprecated.The key used to look up the date patterns used for parsing.static String
HEAD_BODY_CHECK_TIMEOUT
Deprecated.Sets period of time in milliseconds to wait for a content body sent in response toHEAD method
from a non-compliant server.static String
HTTP_CONTENT_CHARSET
Deprecated.Defines the charset to be used for encoding content body.static String
HTTP_ELEMENT_CHARSET
Deprecated.Defines the charset to be used for encoding HTTP protocol elements.static String
HTTP_URI_CHARSET
Deprecated.Defines the charset to be used for parsing URIs.static String
MULTIPART_BOUNDARY
Deprecated.Sets the value to use as the multipart boundary.static String
PROTOCOL_VERSION
Deprecated.Defines theHTTP protocol version
used byHTTP methods
per default.static String
REJECT_HEAD_BODY
Deprecated.Defines whether the content body sent in response toHeadMethod
should be rejected.static String
RETRY_HANDLER
Deprecated.Sets the method retry handler parameter.static String
SINGLE_COOKIE_HEADER
Deprecated.Defines whethercookies
should be put on a singleresponse header
.static String
SO_TIMEOUT
Deprecated.Sets the socket timeout (SO_TIMEOUT) in milliseconds to be used when executing the method.static String
STATUS_LINE_GARBAGE_LIMIT
Deprecated.Defines the maximum number of ignorable lines before we expect a HTTP response's status code.static String
STRICT_TRANSFER_ENCODING
Deprecated.Defines whether responses with an invalid Transfer-Encoding header should be rejected.static String
UNAMBIGUOUS_STATUS_LINE
Deprecated.Defines whetherHTTP methods
should reject ambiguousHTTP status line
.static String
USE_EXPECT_CONTINUE
Deprecated.Activates 'Expect: 100-Continue' handshake for theentity enclosing methods
.static String
USER_AGENT
Deprecated.Defines the content of the User-Agent header used byHTTP methods
.static String
VIRTUAL_HOST
Deprecated.Defines the virtual host name.static String
WARN_EXTRA_INPUT
Deprecated.Defines HttpClient's behavior when a response provides more bytes than expected (specified with Content-Length, for example).
-
Constructor Summary
Constructors Constructor Description HttpMethodParams()
Deprecated.Creates a new collection of parameters with the collection returned byDefaultHttpParams.getDefaultParams()
as a parent.HttpMethodParams(HttpParams defaults)
Deprecated.Creates a new collection of parameters with the given parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getContentCharset()
Deprecated.Returns the default charset to be used for writing content body, when no charset explicitly specified.String
getCookiePolicy()
Deprecated.Returnscookie policy
to be used by theHTTP methods
this collection of parameters applies to.String
getCredentialCharset()
Deprecated.Returns the charset to be used forCredentials
.String
getHttpElementCharset()
Deprecated.Returns the charset to be used for writing HTTP headers.int
getSoTimeout()
Deprecated.Returns the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data.String
getUriCharset()
Deprecated.Returns the charset to be used for parsing URIs.HttpVersion
getVersion()
Deprecated.ReturnsHTTP protocol version
to be used by theHTTP methods
that this collection of parameters applies to.String
getVirtualHost()
Deprecated.Returns the virtual host name.void
makeLenient()
Deprecated.Makes theHTTP 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()
Deprecated.Makes theHTTP methods
strictly follow the HTTP protocol specification (RFC 2616 and other relevant RFCs).void
setContentCharset(String charset)
Deprecated.Sets the default charset to be used for writing content body, when no charset explicitly specified.void
setCookiePolicy(String policy)
Deprecated.Assigns thecookie policy
to be used by theHTTP methods
this collection of parameters applies to.void
setCredentialCharset(String charset)
Deprecated.Sets the charset to be used for writing HTTP headers.void
setHttpElementCharset(String charset)
Deprecated.Sets the charset to be used for writing HTTP headers.void
setSoTimeout(int timeout)
Deprecated.Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data.void
setUriCharset(String charset)
Deprecated.Sets the charset to be used for parsing URIs.void
setVersion(HttpVersion version)
Deprecated.Assigns theHTTP protocol version
to be used by theHTTP methods
that this collection of parameters applies to.void
setVirtualHost(String hostname)
Deprecated.Sets the virtual host name.-
Methods inherited from class org.apache.commons.httpclient.params.DefaultHttpParams
clear, clone, getBooleanParameter, getDefaultParams, getDefaults, getDoubleParameter, getIntParameter, getLongParameter, getParameter, isParameterFalse, isParameterSet, isParameterSetLocally, isParameterTrue, setBooleanParameter, setDefaults, setDoubleParameter, setHttpParamsFactory, setIntParameter, setLongParameter, setParameter, setParameters
-
-
-
-
Field Detail
-
USER_AGENT
public static final String USER_AGENT
Deprecated.Defines the content of the User-Agent header used byHTTP methods
.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
PROTOCOL_VERSION
public static final String PROTOCOL_VERSION
Deprecated.Defines theHTTP protocol version
used byHTTP methods
per default.This parameter expects a value of type
HttpVersion
.- See Also:
- Constant Field Values
-
UNAMBIGUOUS_STATUS_LINE
public static final String UNAMBIGUOUS_STATUS_LINE
Deprecated.Defines whetherHTTP methods
should reject ambiguousHTTP status line
.This parameter expects a value of type
Boolean
.- See Also:
- Constant Field Values
-
SINGLE_COOKIE_HEADER
public static final String SINGLE_COOKIE_HEADER
Deprecated.Defines whethercookies
should be put on a singleresponse header
.This parameter expects a value of type
Boolean
.- See Also:
- Constant Field Values
-
STRICT_TRANSFER_ENCODING
public static final String STRICT_TRANSFER_ENCODING
Deprecated.Defines whether responses with an invalid Transfer-Encoding header should be rejected.This parameter expects a value of type
Boolean
.- See Also:
- Constant Field Values
-
REJECT_HEAD_BODY
public static final String REJECT_HEAD_BODY
Deprecated.Defines whether the content body sent in response toHeadMethod
should be rejected.This parameter expects a value of type
Boolean
.- See Also:
- Constant Field Values
-
HEAD_BODY_CHECK_TIMEOUT
public static final String HEAD_BODY_CHECK_TIMEOUT
Deprecated.Sets period of time in milliseconds to wait for a content body sent in response toHEAD 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
.- See Also:
- Constant Field Values
-
USE_EXPECT_CONTINUE
public static final String USE_EXPECT_CONTINUE
Deprecated.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
.- See Also:
- Constant Field Values
-
CREDENTIAL_CHARSET
public static final String CREDENTIAL_CHARSET
Deprecated.Defines the charset to be used when encodingCredentials
. If not defined then theHTTP_ELEMENT_CHARSET
should be used.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
HTTP_ELEMENT_CHARSET
public static final String HTTP_ELEMENT_CHARSET
Deprecated.Defines the charset to be used for encoding HTTP protocol elements.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
HTTP_URI_CHARSET
public static final String HTTP_URI_CHARSET
Deprecated.Defines the charset to be used for parsing URIs.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
HTTP_CONTENT_CHARSET
public static final String HTTP_CONTENT_CHARSET
Deprecated.Defines the charset to be used for encoding content body.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
COOKIE_POLICY
public static final String COOKIE_POLICY
Deprecated.Definescookie policy
to be used for cookie management.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
WARN_EXTRA_INPUT
public static final String WARN_EXTRA_INPUT
Deprecated.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.This parameter expects a value of type
Boolean
.- See Also:
- Constant Field Values
-
STATUS_LINE_GARBAGE_LIMIT
public static final String STATUS_LINE_GARBAGE_LIMIT
Deprecated.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.
This parameter expects a value of type
To specify no limit, useInteger.MAX_VALUE
(default in lenient mode).Integer
.- See Also:
- Constant Field Values
-
SO_TIMEOUT
public static final String SO_TIMEOUT
Deprecated.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.This parameter expects a value of type
Integer
.- See Also:
SocketOptions.SO_TIMEOUT
, Constant Field Values
-
DATE_PATTERNS
public static final String DATE_PATTERNS
Deprecated.The key used to look up the date patterns used for parsing. The String patterns are stored in aCollection
and must be compatible withSimpleDateFormat
.This parameter expects a value of type
Collection
.- See Also:
- Constant Field Values
-
RETRY_HANDLER
public static final String RETRY_HANDLER
Deprecated.Sets the method retry handler parameter.This parameter expects a value of type
HttpMethodRetryHandler
.- See Also:
- Constant Field Values
-
BUFFER_WARN_TRIGGER_LIMIT
public static final String BUFFER_WARN_TRIGGER_LIMIT
Deprecated.Sets the maximum buffered response size (in bytes) that triggers no warning. Buffered responses exceeding this size will trigger a warning in the log.This parameter expects a value if type
Integer
.- See Also:
- Constant Field Values
-
VIRTUAL_HOST
public static final String VIRTUAL_HOST
Deprecated.Defines the virtual host name.This parameter expects a value of type
String
.- See Also:
- Constant Field Values
-
MULTIPART_BOUNDARY
public static final String MULTIPART_BOUNDARY
Deprecated.Sets the value to use as the multipart boundary.This parameter expects a value if type
String
.- See Also:
MultipartRequestEntity
, Constant Field Values
-
-
Constructor Detail
-
HttpMethodParams
public HttpMethodParams()
Deprecated.Creates a new collection of parameters with the collection returned byDefaultHttpParams.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:
DefaultHttpParams.getDefaultParams()
-
HttpMethodParams
public HttpMethodParams(HttpParams defaults)
Deprecated.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 parameter is not explictly set in the collection itself.- See Also:
DefaultHttpParams.getDefaultParams()
-
-
Method Detail
-
getHttpElementCharset
public String getHttpElementCharset()
Deprecated.Returns the charset to be used for writing HTTP headers.- Returns:
- The charset
-
setHttpElementCharset
public void setHttpElementCharset(String charset)
Deprecated.Sets the charset to be used for writing HTTP headers.- Parameters:
charset
- The charset
-
getContentCharset
public String getContentCharset()
Deprecated.Returns the default charset to be used for writing content body, when no charset explicitly specified.- Returns:
- The charset
-
setUriCharset
public void setUriCharset(String charset)
Deprecated.Sets the charset to be used for parsing URIs.- Parameters:
charset
- The charset
-
getUriCharset
public String getUriCharset()
Deprecated.Returns the charset to be used for parsing URIs.- Returns:
- The charset
-
setContentCharset
public void setContentCharset(String charset)
Deprecated.Sets the default charset to be used for writing content body, when no charset explicitly specified.- Parameters:
charset
- The charset
-
getCredentialCharset
public String getCredentialCharset()
Deprecated.Returns the charset to be used forCredentials
. If not configured theHTTP element charset
is used.- Returns:
- The charset
-
setCredentialCharset
public void setCredentialCharset(String charset)
Deprecated.Sets the charset to be used for writing HTTP headers.- Parameters:
charset
- The charset
-
getVersion
public HttpVersion getVersion()
Deprecated.ReturnsHTTP protocol version
to be used by theHTTP methods
that this collection of parameters applies to.- Returns:
HTTP protocol version
-
setVersion
public void setVersion(HttpVersion version)
Deprecated.Assigns theHTTP protocol version
to be used by theHTTP methods
that this collection of parameters applies to.- Parameters:
version
- theHTTP protocol version
-
getCookiePolicy
public String getCookiePolicy()
Deprecated.Returnscookie policy
to be used by theHTTP methods
this collection of parameters applies to.- Returns:
cookie policy
-
setCookiePolicy
public void setCookiePolicy(String policy)
Deprecated.Assigns thecookie policy
to be used by theHTTP methods
this collection of parameters applies to.- Parameters:
policy
- thecookie policy
-
getSoTimeout
public int getSoTimeout()
Deprecated.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.- Returns:
- timeout in milliseconds
-
setSoTimeout
public void setSoTimeout(int timeout)
Deprecated.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
-
setVirtualHost
public void setVirtualHost(String hostname)
Deprecated.Sets the virtual host name.- Parameters:
hostname
- The host name
-
getVirtualHost
public String getVirtualHost()
Deprecated.Returns the virtual host name.- Returns:
- The virtual host name
-
makeStrict
public void makeStrict()
Deprecated.Makes theHTTP 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.
-
makeLenient
public void makeLenient()
Deprecated.Makes theHTTP 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).
-
-