| Constructor and Description |
|---|
Response(byte[] body)
Constructs a successful (200 OK) response from raw body bytes.
|
Response(int statusCode)
Constructs a response from the given status code.
|
Response(int statusCode,
byte[] body)
Constructs a response from a status code and raw body bytes.
|
Response(int statusCode,
InputStream body)
Constructs a response from a status code and body.
|
Response(int statusCode,
Map<String,String> headers)
Constructs a response from a status and headers.
|
Response(int statusCode,
Map<String,String> headers,
InputStream body)
Constructs a response from a status code, headers, and bodu.
|
Response(int statusCode,
Map<String,String> headers,
String body)
Constructs a response from a status, headers, and a body represented by a
String. |
Response(int statusCode,
String body)
Constructs a response from a status and a body represented by a
String. |
Response(String body)
Constructs a successful (200 OK) response from a body represented by a
String. |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getBody()
Returns the body of the response; may be null.
|
Map<String,String> |
getHeaders()
Returns the headers of the response.
|
int |
getStatusCode()
Returns the status code of the response.
|
public Response(int statusCode,
Map<String,String> headers,
InputStream body)
statusCode - the status code of the response.headers - the headers of the response.body - the body of the response.public Response(int statusCode,
InputStream body)
statusCode - the status code of the response.body - the body of the response.public Response(int statusCode,
byte[] body)
statusCode - the status code of the response.body - the body of the response as raw bytes.public Response(int statusCode,
Map<String,String> headers,
String body)
String.statusCode - the status code of the response.headers - the headers of the response.body - the body of the response as a string.public Response(int statusCode,
String body)
String.statusCode - the status code of the response.body - the body of the response as a string.public Response(int statusCode,
Map<String,String> headers)
statusCode - the status code of the response.headers - the headers of the response.public Response(byte[] body)
body - the body of the response as raw bytes.public Response(String body)
String.body - the body of the response as a string.public Response(int statusCode)
statusCode - the status code of the response.public int getStatusCode()
public Map<String,String> getHeaders()
@Nullable public InputStream getBody()