org.apache.commons.httpclient.params
Class HttpClientParams
- Cloneable, HttpParams, Serializable
public class HttpClientParams
This class represents a collection of HTTP protocol parameters applicable to
instances of HttpClient
.
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.
BUFFER_WARN_TRIGGER_LIMIT , COOKIE_POLICY , CREDENTIAL_CHARSET , DATE_PATTERNS , HEAD_BODY_CHECK_TIMEOUT , HTTP_CONTENT_CHARSET , HTTP_ELEMENT_CHARSET , MULTIPART_BOUNDARY , PROTOCOL_VERSION , REJECT_HEAD_BODY , RETRY_HANDLER , SINGLE_COOKIE_HEADER , SO_TIMEOUT , STATUS_LINE_GARBAGE_LIMIT , STRICT_TRANSFER_ENCODING , UNAMBIGUOUS_STATUS_LINE , USER_AGENT , USE_EXPECT_CONTINUE , VIRTUAL_HOST , WARN_EXTRA_INPUT |
getContentCharset , getCookiePolicy , getCredentialCharset , getHttpElementCharset , getSoTimeout , getVersion , getVirtualHost , makeLenient , makeStrict , setContentCharset , setCookiePolicy , setCredentialCharset , setHttpElementCharset , setSoTimeout , setVersion , setVirtualHost |
clear , clone , getBooleanParameter , getDefaultParams , getDefaults , getDoubleParameter , getIntParameter , getLongParameter , getParameter , isParameterFalse , isParameterSet , isParameterSetLocally , isParameterTrue , setBooleanParameter , setDefaults , setDoubleParameter , setHttpParamsFactory , setIntParameter , setLongParameter , setParameter , setParameters |
ALLOW_CIRCULAR_REDIRECTS
public static final String ALLOW_CIRCULAR_REDIRECTS
Defines whether circular redirects (redirects to the same location) should be allowed.
The HTTP spec is not sufficiently clear whether circular redirects are permitted,
therefore optionally they can be enabled
This parameter expects a value of type
Boolean
.
CONNECTION_MANAGER_CLASS
public static final String CONNECTION_MANAGER_CLASS
CONNECTION_MANAGER_TIMEOUT
public static final String CONNECTION_MANAGER_TIMEOUT
MAX_REDIRECTS
public static final String MAX_REDIRECTS
Defines the maximum number of redirects to be followed.
The limit on number of redirects is intended to prevent infinite loops.
This parameter expects a value of type
Integer
.
PREEMPTIVE_AUTHENTICATION
public static final String PREEMPTIVE_AUTHENTICATION
Defines whether authentication should be attempted preemptively.
This parameter expects a value of type
Boolean
.
REJECT_RELATIVE_REDIRECT
public static final String REJECT_RELATIVE_REDIRECT
Defines whether relative redirects should be rejected.
This parameter expects a value of type
Boolean
.
HttpClientParams
public HttpClientParams()
Creates a new collection of parameters with the collection returned
by
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.
HttpClientParams
public HttpClientParams(HttpParams defaults)
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.
defaults
- the parent collection to defer to, if a parameter
is not explictly set in the collection itself.
getConnectionManagerClass
public Class getConnectionManagerClass()
getConnectionManagerTimeout
public long getConnectionManagerTimeout()
isAuthenticationPreemptive
public boolean isAuthenticationPreemptive()
Returns true if authentication should be attempted preemptively,
false otherwise.
- true if authentication should be attempted preemptively,
false otherwise.
makeLenient
public 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).
- makeLenient in interface HttpMethodParams
makeStrict
public void makeStrict()
Makes the
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.
- makeStrict in interface HttpMethodParams
setAuthenticationPreemptive
public void setAuthenticationPreemptive(boolean value)
Sets whether authentication should be attempted preemptively.
value
- true if authentication should be attempted preemptively,
false otherwise.
setConnectionManagerClass
public void setConnectionManagerClass(Class clazz)
setConnectionManagerTimeout
public void setConnectionManagerTimeout(long timeout)
timeout
- the timeout in milliseconds
Copyright (c) 1999-2005 - Apache Software Foundation