|
|||||
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,
java.net.URL url,
SubmitMethod requestMethod,
long loadTime)
Construct with all data |
|
WebResponseImpl(WebResponseData responseData,
java.net.URL url,
SubmitMethod requestMethod,
long loadTime)
Construct with all data |
Method Summary | |
---|---|
java.io.InputStream |
getContentAsStream()
Return the content from the server as an input stream |
java.lang.String |
getContentAsString()
Return the content from the server as a string |
java.lang.String |
getContentCharSet()
Return the content charset value. If no charset is specified in headers, then try to guess it from the content. |
java.lang.String |
getContentType()
Return the content type returned from the server. |
long |
getLoadTimeInMilliSeconds()
Return the time it took to load this web response in milliseconds. |
SubmitMethod |
getRequestMethod()
Return the method used for the request resulting into this response. |
byte[] |
getResponseBody()
Return the response body as byte array. |
java.util.List |
getResponseHeaders()
Return the response headers as a List of NameValuePair s. |
java.lang.String |
getResponseHeaderValue(java.lang.String headerName)
Return the value of the specified header from this response. |
int |
getStatusCode()
Return the status code that was returned by the server |
java.lang.String |
getStatusMessage()
Return the status message that was returned from the server |
java.net.URL |
getUrl()
Return the URL that was used to load this page. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebResponseImpl(WebResponseData responseData, java.lang.String charset, java.net.URL url, SubmitMethod requestMethod, long loadTime)
responseData
- Data that was send backcharset
- Charset used if not returned in the response.url
- Where this response came fromrequestMethod
- The method used to get this responseloadTime
- How long the response took to be sentpublic WebResponseImpl(WebResponseData responseData, java.net.URL url, SubmitMethod 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 sentMethod Detail |
---|
public java.io.InputStream getContentAsStream() throws java.io.IOException
getContentAsStream
in interface WebResponse
java.io.IOException
- If an IO problem occurspublic java.lang.String getContentAsString()
getContentAsString
in interface WebResponse
public java.lang.String getContentCharSet()
getContentCharSet
in interface WebResponse
TextUtil.DEFAULT_CHARSET
if it can't be determinedpublic java.lang.String getContentType()
getContentType
in interface WebResponse
public long getLoadTimeInMilliSeconds()
getLoadTimeInMilliSeconds
in interface WebResponse
public SubmitMethod getRequestMethod()
getRequestMethod
in interface WebResponse
public byte[] getResponseBody()
getResponseBody
in interface WebResponse
public java.util.List getResponseHeaders()
NameValuePair
s.
getResponseHeaders
in interface WebResponse
NameValuePair
s.public java.lang.String getResponseHeaderValue(java.lang.String headerName)
getResponseHeaderValue
in interface WebResponse
headerName
- The name of the header
public int getStatusCode()
getStatusCode
in interface WebResponse
public java.lang.String getStatusMessage()
getStatusMessage
in interface WebResponse
public java.net.URL getUrl()
getUrl
in interface WebResponse
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |