|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gargoylesoftware.htmlunit.WebRequestSettings
public class WebRequestSettings
Parameter object for making web requests
Constructor Summary | |
---|---|
WebRequestSettings(java.net.URL target)
|
|
WebRequestSettings(java.net.URL target,
SubmitMethod submitMethod)
|
|
WebRequestSettings(WebRequestSettings originalRequest,
java.net.URL target)
Instantiate a WebRequestSettings for the given url using the proxy configuration from the original
request |
Method Summary | |
---|---|
void |
addAdditionalHeader(java.lang.String name,
java.lang.String value)
Adds the specified name/value pair to the additional headers. |
java.util.Map |
getAdditionalHeaders()
|
java.lang.String |
getCharset()
Gets the charset to use to perform the request |
java.lang.String |
getCookiePolicy()
Gets the cookie policy to use to perform the request. |
org.apache.commons.httpclient.auth.CredentialsProvider |
getCredentialsProvider()
|
FormEncodingType |
getEncodingType()
|
java.lang.String |
getProxyHost()
|
int |
getProxyPort()
|
java.lang.String |
getRequestBody()
Returns the body content to be submitted if this is a POST request. |
java.util.List |
getRequestParameters()
|
SubmitMethod |
getSubmitMethod()
|
java.net.URL |
getURL()
|
void |
setAdditionalHeaders(java.util.Map additionalHeaders)
|
void |
setCharset(java.lang.String charset)
Sets the charset. |
void |
setCookiePolicy(java.lang.String cookiePolicy)
Sets the cookie policy. |
void |
setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
|
void |
setEncodingType(FormEncodingType encodingType)
|
void |
setProxyHost(java.lang.String proxyHost)
|
void |
setProxyPort(int proxyPort)
|
void |
setRequestBody(java.lang.String requestBody)
|
void |
setRequestParameters(java.util.List requestParameters)
|
void |
setSubmitMethod(SubmitMethod submitMethod)
|
void |
setURL(java.net.URL url)
|
java.lang.String |
toString()
Return a string representation of this object |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WebRequestSettings(java.net.URL target)
target
- The URL for this requestpublic WebRequestSettings(java.net.URL target, SubmitMethod submitMethod)
target
- The URL for this requestsubmitMethod
- The submitMethod to set.public WebRequestSettings(WebRequestSettings originalRequest, java.net.URL target)
WebRequestSettings
for the given url using the proxy configuration from the original
request
originalRequest
- the original requesttarget
- The URL for this requestMethod Detail |
---|
public void addAdditionalHeader(java.lang.String name, java.lang.String value)
name
- The name of the additional header.value
- The value of the additional header.public java.util.Map getAdditionalHeaders()
public java.lang.String getCharset()
public java.lang.String getCookiePolicy()
public org.apache.commons.httpclient.auth.CredentialsProvider getCredentialsProvider()
public FormEncodingType getEncodingType()
public java.lang.String getProxyHost()
public int getProxyPort()
public java.lang.String getRequestBody()
public java.util.List getRequestParameters()
public SubmitMethod getSubmitMethod()
public java.net.URL getURL()
public void setAdditionalHeaders(java.util.Map additionalHeaders)
additionalHeaders
- The additionalHeaders to set.public void setCharset(java.lang.String charset)
TextUtil.DEFAULT_CHARSET
charset
- the new charsetpublic void setCookiePolicy(java.lang.String cookiePolicy)
CookiePolicy.DEFAULT
cookiePolicy
- the new cookie policy.public void setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
credentialsProvider
- The credentialProvider to set.public void setEncodingType(FormEncodingType encodingType)
encodingType
- The encodingType to set.public void setProxyHost(java.lang.String proxyHost)
proxyHost
- The new proxy host.public void setProxyPort(int proxyPort)
proxyPort
- The new proxy port.public void setRequestBody(java.lang.String requestBody) throws java.lang.RuntimeException
requestBody
- The body content to be submitted if this is a POST request.
java.lang.RuntimeException
- If the request parameters have already been set or this is not a POST request.public void setRequestParameters(java.util.List requestParameters) throws java.lang.RuntimeException
requestParameters
- The requestParameters to set.
java.lang.RuntimeException
- If the request body has already been set.public void setSubmitMethod(SubmitMethod submitMethod)
submitMethod
- The submitMethod to set.public void setURL(java.net.URL url)
url
- The new URLpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |