|
||||||||||
| 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 url)
Instantiates a WebRequestSettings for the specified URL. |
|
WebRequestSettings(URL url,
HttpMethod submitMethod)
Instantiates a WebRequestSettings for the specified URL using the specified HTTP submit method. |
|
WebRequestSettings(WebRequestSettings originalRequest,
URL url)
Instantiates a WebRequestSettings for the specified URL using the proxy configuration from the
specified original request. |
|
| Method Summary | |
|---|---|
void |
addAdditionalHeader(String name,
String value)
Adds the specified name/value pair to the additional HTTP headers. |
Map<String,String> |
getAdditionalHeaders()
Returns the additional HTTP headers to use. |
String |
getCharset()
Returns the character set to use to perform the request. |
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. |
String |
getProxyHost()
Returns the proxy host to use. |
int |
getProxyPort()
Returns the proxy port to use. |
String |
getRequestBody()
Returns the body content to be submitted if this is a POST request. |
List<NameValuePair> |
getRequestParameters()
Retrieves the request parameters to use. |
URL |
getUrl()
Returns the target URL. |
void |
setAdditionalHeaders(Map<String,String> additionalHeaders)
Sets the additional HTTP headers to use. |
void |
setCharset(String charset)
Sets the character set to use to perform the request. |
void |
setCredentialsProvider(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(String proxyHost)
Sets the proxy host to use. |
void |
setProxyPort(int proxyPort)
Sets the proxy port to use. |
void |
setRequestBody(String requestBody)
Sets the body content to be submitted if this is a POST request. |
void |
setRequestParameters(List<NameValuePair> requestParameters)
Sets the request parameters to use. |
void |
setUrl(URL url)
Sets the target URL. |
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(URL url)
WebRequestSettings for the specified URL.
url - the target URL
public WebRequestSettings(WebRequestSettings originalRequest,
URL url)
WebRequestSettings for the specified URL using the proxy configuration from the
specified original request.
originalRequest - the original requesturl - the target URL
public WebRequestSettings(URL url,
HttpMethod submitMethod)
WebRequestSettings for the specified URL using the specified HTTP submit method.
url - the target URLsubmitMethod - the HTTP submit method to use| Method Detail |
|---|
public URL getUrl()
public void setUrl(URL url)
url - the target URLpublic String getProxyHost()
public void setProxyHost(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 List<NameValuePair> getRequestParameters()
URL. Should not be used in
combination with the request body.
public void setRequestParameters(List<NameValuePair> requestParameters)
throws RuntimeException
URL. Should not be used in combination
with the request body.
requestParameters - the request parameters to use
RuntimeException - if the request body has already been setpublic String getRequestBody()
request parameters.
public void setRequestBody(String requestBody)
throws RuntimeException
request parameters.
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 requestpublic HttpMethod getHttpMethod()
public void setHttpMethod(HttpMethod submitMethod)
submitMethod - the HTTP submit method to usepublic Map<String,String> getAdditionalHeaders()
public void setAdditionalHeaders(Map<String,String> additionalHeaders)
additionalHeaders - the additional HTTP headers to use
public void addAdditionalHeader(String name,
String value)
name - the name of the additional HTTP headervalue - the value of the additional HTTP headerpublic CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
credentialsProvider - the credentials provider to usepublic String getCharset()
public void setCharset(String charset)
TextUtil.DEFAULT_CHARSET.
charset - the character set to use to perform the requestpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||