public class WebResponseData extends Object implements Serializable
| Modifier | Constructor and Description |
|---|---|
|
WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
Constructs with a raw byte[] (mostly for testing).
|
|
WebResponseData(DownloadedContent responseBody,
int statusCode,
String statusMessage,
List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
Constructor.
|
|
WebResponseData(InputStream bodyStream,
int statusCode,
String statusMessage,
List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
Deprecated.
As of HtmlUnit-2.8.
|
protected |
WebResponseData(int statusCode,
String statusMessage,
List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
Constructs without data stream for subclasses that override getBody().
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBody()
Returns the response body.
|
InputStream |
getInputStream()
Returns a new
InputStream allowing to read the downloaded content. |
List<org.apache.commons.httpclient.NameValuePair> |
getResponseHeaders() |
int |
getStatusCode() |
String |
getStatusMessage() |
public WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
body - Body of this responsestatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responseIOException - on stream errors@Deprecated public WebResponseData(InputStream bodyStream, int statusCode, String statusMessage, List<org.apache.commons.httpclient.NameValuePair> responseHeaders) throws IOException
bodyStream - Stream of this response's bodystatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responseIOException - on stream errorsprotected WebResponseData(int statusCode,
String statusMessage,
List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
throws IOException
statusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responseIOException - on stream errorspublic WebResponseData(DownloadedContent responseBody, int statusCode, String statusMessage, List<org.apache.commons.httpclient.NameValuePair> responseHeaders)
responseBody - the downloaded response bodystatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responseIOException - on stream errorspublic byte[] getBody()
public InputStream getInputStream()
InputStream allowing to read the downloaded content.public List<org.apache.commons.httpclient.NameValuePair> getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.