public class WebResponseData extends Object implements Serializable
Modifier | Constructor and Description |
---|---|
|
WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructs with a raw byte[] (mostly for testing).
|
|
WebResponseData(DownloadedContent responseBody,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Constructor.
|
|
WebResponseData(InputStream bodyStream,
int statusCode,
String statusMessage,
List<NameValuePair> responseHeaders)
Deprecated.
As of HtmlUnit-2.8.
|
protected |
WebResponseData(int statusCode,
String statusMessage,
List<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<NameValuePair> |
getResponseHeaders() |
int |
getStatusCode() |
String |
getStatusMessage() |
public WebResponseData(byte[] body, int statusCode, String statusMessage, List<NameValuePair> responseHeaders) throws IOException
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<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<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<NameValuePair> responseHeaders) throws IOException
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<NameValuePair> getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
Copyright © 2002–2013 Gargoyle Software Inc.. All rights reserved.