|
||||||||||
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(java.net.URL url)
Instantiates a WebRequestSettings for the specified URL. |
|
WebRequestSettings(java.net.URL url,
HttpMethod submitMethod)
Instantiates a WebRequestSettings for the specified URL using the specified HTTP submit method. |
|
WebRequestSettings(WebRequestSettings originalRequest,
java.net.URL url)
Instantiates a WebRequestSettings for the specified URL using the proxy configuration from the
specified original request. |
Method Summary | |
---|---|
void |
addAdditionalHeader(java.lang.String name,
java.lang.String value)
Deprecated. As of 2.6, please use setAdditionalHeader(String, String) instead |
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalHeaders()
Returns the additional HTTP headers to use. |
java.lang.String |
getCharset()
Returns the character set to use to perform the request. |
org.apache.commons.httpclient.auth.CredentialsProvider |
getCredentialsProvider()
Returns the credentials provider to use. |
FormEncodingType |
getEncodingType()
Returns the form encoding type to use. |
HttpMethod |
getHttpMethod()
Returns the HTTP submit method to use. |
java.lang.String |
getProxyHost()
Returns the proxy host to use. |
int |
getProxyPort()
Returns the proxy port to use. |
java.lang.String |
getRequestBody()
Returns the body content to be submitted if this is a POST request. |
java.util.List<org.apache.commons.httpclient.NameValuePair> |
getRequestParameters()
Retrieves the request parameters to use. |
java.net.URL |
getUrl()
Returns the target URL. |
void |
removeAdditionalHeader(java.lang.String name)
Removed the specified name/value pair from the additional HTTP headers. |
void |
setAdditionalHeader(java.lang.String name,
java.lang.String value)
Sets the specified name/value pair in the additional HTTP headers. |
void |
setAdditionalHeaders(java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
Sets the additional HTTP headers to use. |
void |
setCharset(java.lang.String charset)
Sets the character set to use to perform the request. |
void |
setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
Sets the credentials provider to use. |
void |
setEncodingType(FormEncodingType encodingType)
Sets the form encoding type to use. |
void |
setHttpMethod(HttpMethod submitMethod)
Sets the HTTP submit method to use. |
void |
setProxyHost(java.lang.String proxyHost)
Sets the proxy host to use. |
void |
setProxyPort(int proxyPort)
Sets the proxy port to use. |
void |
setRequestBody(java.lang.String requestBody)
Sets the body content to be submitted if this is a POST request. |
void |
setRequestParameters(java.util.List<org.apache.commons.httpclient.NameValuePair> requestParameters)
Sets the request parameters to use. |
void |
setUrl(java.net.URL url)
Sets the target URL. |
java.lang.String |
toString()
Returns 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(java.net.URL url)
WebRequestSettings
for the specified URL.
url
- the target URLpublic WebRequestSettings(WebRequestSettings originalRequest, java.net.URL url)
WebRequestSettings
for the specified URL using the proxy configuration from the
specified original request.
originalRequest
- the original requesturl
- the target URLpublic WebRequestSettings(java.net.URL url, HttpMethod submitMethod)
WebRequestSettings
for the specified URL using the specified HTTP submit method.
url
- the target URLsubmitMethod
- the HTTP submit method to useMethod Detail |
---|
public java.net.URL getUrl()
public void setUrl(java.net.URL url)
url
- the target URLpublic java.lang.String getProxyHost()
public void setProxyHost(java.lang.String proxyHost)
proxyHost
- the proxy host to usepublic int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort
- the proxy port to usepublic FormEncodingType getEncodingType()
public void setEncodingType(FormEncodingType encodingType)
encodingType
- the form encoding type to usepublic java.util.List<org.apache.commons.httpclient.NameValuePair> getRequestParameters()
URL
. Should not be used in
combination with the request body
.
public void setRequestParameters(java.util.List<org.apache.commons.httpclient.NameValuePair> requestParameters) throws java.lang.RuntimeException
URL
. Should not be used in combination
with the request body
.
requestParameters
- the request parameters to use
java.lang.RuntimeException
- if the request body has already been setpublic java.lang.String getRequestBody()
request parameters
.
public void setRequestBody(java.lang.String requestBody) throws java.lang.RuntimeException
request parameters
.
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 requestpublic HttpMethod getHttpMethod()
public void setHttpMethod(HttpMethod submitMethod)
submitMethod
- the HTTP submit method to usepublic java.util.Map<java.lang.String,java.lang.String> getAdditionalHeaders()
public void setAdditionalHeaders(java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
additionalHeaders
- the additional HTTP headers to usepublic void setAdditionalHeader(java.lang.String name, java.lang.String value)
name
- the name of the additional HTTP headervalue
- the value of the additional HTTP header@Deprecated public void addAdditionalHeader(java.lang.String name, java.lang.String value)
setAdditionalHeader(String, String)
instead
name
- the name of the additional HTTP headervalue
- the value of the additional HTTP headerpublic void removeAdditionalHeader(java.lang.String name)
name
- the name of the additional HTTP headerpublic org.apache.commons.httpclient.auth.CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
credentialsProvider
- the credentials provider to usepublic java.lang.String getCharset()
public void setCharset(java.lang.String charset)
TextUtil.DEFAULT_CHARSET
.
charset
- the character set to use to perform the requestpublic 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 |