public interface WebResponse extends Serializable
Modifier and Type | Method and Description |
---|---|
byte[] |
getContentAsBytes()
Returns the response content as a byte array.
|
InputStream |
getContentAsStream()
Returns the response content as an input stream.
|
String |
getContentAsString()
Returns the response content as a string, using the charset/encoding specified in the server response.
|
String |
getContentAsString(String encoding)
Returns the response content as a string, using the specified charset/encoding,
rather than the charset/encoding specified in the server response.
|
String |
getContentCharset()
Returns the content charset for this response, even if no charset was specified explicitly.
|
String |
getContentCharSet()
Deprecated.
as of 2.6, please use
getContentCharset() |
String |
getContentCharsetOrNull()
Returns the content charset specified explicitly in the header or in the content,
or null if none was specified.
|
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.
|
URL |
getRequestUrl()
Deprecated.
as of 2.6, please use
getRequestSettings() .getUrl() |
List<org.apache.commons.httpclient.NameValuePair> |
getResponseHeaders()
Returns the response headers as a list of
NameValuePair s. |
String |
getResponseHeaderValue(String headerName)
Returns the value of the specified response header.
|
int |
getStatusCode()
Returns the status code that was returned by the server.
|
String |
getStatusMessage()
Returns the status message that was returned from the server.
|
URL |
getUrl()
Synonym for
getRequestUrl() |
WebRequestSettings getRequestSettings()
@Deprecated HttpMethod getRequestMethod()
getRequestSettings()
.getHttpMethod()@Deprecated URL getRequestUrl()
getRequestSettings()
.getUrl()URL getUrl()
getRequestUrl()
List<org.apache.commons.httpclient.NameValuePair> getResponseHeaders()
NameValuePair
s.NameValuePair
sString getResponseHeaderValue(String headerName)
headerName
- the name of the header whose value is to be returnedint getStatusCode()
String getStatusMessage()
String getContentType()
@Deprecated String getContentCharSet()
getContentCharset()
String getContentCharsetOrNull()
String getContentCharset()
TextUtil.DEFAULT_CHARSET
.String getContentAsString()
String getContentAsString(String encoding)
encoding
- the charset/encoding to use to convert the response content into a stringInputStream getContentAsStream() throws IOException
IOException
- if an IO problem occursbyte[] getContentAsBytes()
long getLoadTime()
Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.