public class WebRequestSettings extends Object
Constructor and Description |
---|
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 |
Modifier and Type | Method and Description |
---|---|
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.
|
org.apache.commons.httpclient.auth.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(org.apache.commons.httpclient.auth.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
|
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
requestoriginalRequest
- the original requesttarget
- The URL for this requestpublic WebRequestSettings(URL target, SubmitMethod submitMethod)
target
- The URL for this requestsubmitMethod
- The submitMethod to set.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 org.apache.commons.httpclient.auth.CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
credentialsProvider
- The credentialProvider to set.public String toString()
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)
Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.