@InterfaceAudience.Public @InterfaceStability.Stable public class Response extends java.lang.Object
| Constructor and Description |
|---|
Response(int code)
Constructor
|
Response(int code,
Header[] headers)
Constructor
|
Response(int code,
Header[] headers,
byte[] body)
Constructor
|
Response(int code,
Header[] headers,
HttpResponse resp,
java.io.InputStream in)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBody() |
int |
getCode() |
java.lang.String |
getHeader(java.lang.String key) |
Header[] |
getHeaders() |
java.lang.String |
getLocation() |
java.io.InputStream |
getStream()
Gets the input stream instance.
|
boolean |
hasBody() |
void |
setBody(byte[] body) |
void |
setCode(int code) |
void |
setHeaders(Header[] headers) |
public Response(int code)
code - the HTTP response codepublic Response(int code,
Header[] headers)
code - the HTTP response codeheaders - the HTTP response headerspublic Response(int code,
Header[] headers,
byte[] body)
code - the HTTP response codeheaders - the HTTP response headersbody - the response body, can be nullpublic Response(int code,
Header[] headers,
HttpResponse resp,
java.io.InputStream in)
code - the HTTP response codeheaders - headers the HTTP response headersresp - the responsein - Inputstream if the response had one.public int getCode()
public java.io.InputStream getStream()
public Header[] getHeaders()
public java.lang.String getHeader(java.lang.String key)
public java.lang.String getLocation()
public boolean hasBody()
public byte[] getBody()
public void setCode(int code)
code - the HTTP response codepublic void setHeaders(Header[] headers)
headers - the HTTP response headerspublic void setBody(byte[] body)
body - the response body