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