public class HttpResponse extends Object
| Constructor and Description |
|---|
HttpResponse(String status,
int statusCode,
long contentLength,
Map<String,Collection<String>> headers,
Map<String,HttpCookie> cookies,
byte[] body)
Constructs a new response to an HTTP request.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBody()
Returns a copy of the response body.
|
long |
getContentLength()
Returns the content length of the response.
|
Map<String,HttpCookie> |
getCookies()
Returns the response cookies.
|
Map<String,Collection<String>> |
getHeaders()
Returns the response headers.
|
String |
getStatus()
Returns the human readable status of the response.
|
int |
getStatusCode()
Returns the status code of the response.
|
public HttpResponse(String status, int statusCode, long contentLength, Map<String,Collection<String>> headers, Map<String,HttpCookie> cookies, byte[] body)
status - the human readable status of the response.statusCode - the status code of the response.contentLength - the content length of the response.headers - the response headers.cookies - the response cookies.body - the response body.@Nonnull public String getStatus()
public int getStatusCode()
public long getContentLength()
@Nullable public Map<String,Collection<String>> getHeaders()
@Nullable public Map<String,HttpCookie> getCookies()
@Nullable public byte[] getBody()