|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.htmlunit.WebResponseImpl
public class WebResponseImpl
Simple base class for WebResponse.
| Constructor Summary | |
|---|---|
WebResponseImpl(WebResponseData responseData,
java.lang.String charset,
WebRequestSettings requestSettings,
long loadTime)
Deprecated. As of 2.6, please use @link WebResponseImpl(WebResponseData, WebRequestSettings, long) |
|
WebResponseImpl(WebResponseData responseData,
java.net.URL url,
HttpMethod requestMethod,
long loadTime)
Constructs with all data. |
|
WebResponseImpl(WebResponseData responseData,
WebRequestSettings requestSettings,
long loadTime)
Constructs with all data. |
|
| Method Summary | |
|---|---|
byte[] |
getContentAsBytes()
Returns the response content as a byte array. |
java.io.InputStream |
getContentAsStream()
Returns the response content as an input stream. |
java.lang.String |
getContentAsString()
Returns the response content as a string, using the charset/encoding specified in the server response. |
java.lang.String |
getContentAsString(java.lang.String encoding)
Returns the response content as a string, using the specified charset/encoding, rather than the charset/encoding specified in the server response. |
java.lang.String |
getContentCharset()
Returns the content charset for this response, even if no charset was specified explicitly. |
java.lang.String |
getContentCharSet()
Deprecated. As of 2.6, please use @link getContentCharset() |
java.lang.String |
getContentCharsetOrNull()
Returns the content charset specified explicitly in the header or in the content, or null if none was specified. |
java.lang.String |
getContentType()
Returns the content type returned from the server, e.g. |
long |
getLoadTime()
Returns the time it took to load this web response, in milliseconds. |
HttpMethod |
getRequestMethod()
Deprecated. As of 2.6, please use getRequestSettings().getHttpMethod() |
WebRequestSettings |
getRequestSettings()
Returns the request settings used to load this response. |
java.net.URL |
getRequestUrl()
Deprecated. As of 2.6, please use getRequestSettings().getUrl() |
java.util.List<org.apache.commons.httpclient.NameValuePair> |
getResponseHeaders()
Returns the response headers as a list of NameValuePairs. |
java.lang.String |
getResponseHeaderValue(java.lang.String headerName)
Returns the value of the specified response header. |
int |
getStatusCode()
Returns the status code that was returned by the server. |
java.lang.String |
getStatusMessage()
Returns the status message that was returned from the server. |
java.net.URL |
getUrl()
Synonym for WebResponse.getRequestUrl() |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebResponseImpl(WebResponseData responseData,
java.net.URL url,
HttpMethod requestMethod,
long loadTime)
responseData - Data that was send backurl - Where this response came fromrequestMethod - the method used to get this responseloadTime - How long the response took to be sent
@Deprecated
public WebResponseImpl(WebResponseData responseData,
java.lang.String charset,
WebRequestSettings requestSettings,
long loadTime)
WebResponseImpl(WebResponseData, WebRequestSettings, long)
responseData - Data that was send backcharset - Charset used if not returned in the responserequestSettings - the request settings used to get this responseloadTime - How long the response took to be sent
public WebResponseImpl(WebResponseData responseData,
WebRequestSettings requestSettings,
long loadTime)
responseData - Data that was send backrequestSettings - the request settings used to get this responseloadTime - How long the response took to be sent| Method Detail |
|---|
public WebRequestSettings getRequestSettings()
getRequestSettings in interface WebResponse@Deprecated public HttpMethod getRequestMethod()
getRequestSettings().getHttpMethod()
getRequestMethod in interface WebResponse@Deprecated public java.net.URL getRequestUrl()
getRequestSettings().getUrl()
getRequestUrl in interface WebResponsepublic java.net.URL getUrl()
WebResponseWebResponse.getRequestUrl()
getUrl in interface WebResponsepublic java.util.List<org.apache.commons.httpclient.NameValuePair> getResponseHeaders()
NameValuePairs.
getResponseHeaders in interface WebResponseNameValuePairspublic java.lang.String getResponseHeaderValue(java.lang.String headerName)
getResponseHeaderValue in interface WebResponseheaderName - the name of the header whose value is to be returned
public int getStatusCode()
getStatusCode in interface WebResponsepublic java.lang.String getStatusMessage()
getStatusMessage in interface WebResponsepublic java.lang.String getContentType()
getContentType in interface WebResponse@Deprecated public java.lang.String getContentCharSet()
getContentCharset()
getContentCharSet in interface WebResponseTextUtil.DEFAULT_CHARSET if it can't be determinedpublic java.lang.String getContentCharsetOrNull()
getContentCharsetOrNull in interface WebResponsepublic java.lang.String getContentCharset()
TextUtil.DEFAULT_CHARSET.
getContentCharset in interface WebResponsepublic java.lang.String getContentAsString()
getContentAsString in interface WebResponsepublic java.lang.String getContentAsString(java.lang.String encoding)
getContentAsString in interface WebResponseencoding - the charset/encoding to use to convert the response content into a string
public java.io.InputStream getContentAsStream()
throws java.io.IOException
getContentAsStream in interface WebResponsejava.io.IOException - if an IO problem occurspublic byte[] getContentAsBytes()
getContentAsBytes in interface WebResponsepublic long getLoadTime()
getLoadTime in interface WebResponse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||