public final class HttpResponse
extends java.lang.Object
Constructor and Description |
---|
HttpResponse(int statusCode,
java.util.List<Header> headers)
Construct a new HttpResponse for an empty response body.
|
HttpResponse(int statusCode,
java.util.List<Header> headers,
int contentLength,
java.io.InputStream content)
Construct a new HttpResponse.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getContent()
Returns an
InputStream of the response content. |
int |
getContentLength()
Returns the length of the content.
|
java.util.List<Header> |
getHeaders()
Returns the response headers.
|
int |
getStatusCode()
Returns the HTTP status code of the response.
|
public HttpResponse(int statusCode, java.util.List<Header> headers)
statusCode
- the HTTP status code of the responseheaders
- the response headerspublic HttpResponse(int statusCode, java.util.List<Header> headers, int contentLength, java.io.InputStream content)
statusCode
- the HTTP status code of the responseheaders
- the response headerscontentLength
- the length of the response content. Ignored if there is no content.content
- an InputStream
of the response content. May be null to indicate that
the response has no content.public final int getStatusCode()
public final java.util.List<Header> getHeaders()
public final int getContentLength()
getContent()
is non-null.public final java.io.InputStream getContent()
InputStream
of the response content. May be null to indicate that the
response has no content.