public interface Response
AsyncCompletionHandler
Modifier and Type | Interface and Description |
---|---|
static class |
Response.ResponseBuilder |
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Return the content-type header value.
|
List<Cookie> |
getCookies() |
String |
getHeader(String name) |
io.netty.handler.codec.http.HttpHeaders |
getHeaders() |
List<String> |
getHeaders(String name)
Return a
List of the response header value. |
SocketAddress |
getLocalAddress()
Get local address client initiated request from.
|
SocketAddress |
getRemoteAddress()
Get remote address client initiated request to.
|
String |
getResponseBody()
Return the entire response body as a String.
|
String |
getResponseBody(Charset charset)
Return the entire response body as a String.
|
ByteBuffer |
getResponseBodyAsByteBuffer()
Return the entire response body as a ByteBuffer.
|
byte[] |
getResponseBodyAsBytes()
Return the entire response body as a byte[].
|
InputStream |
getResponseBodyAsStream()
Returns an input stream for the response body.
|
int |
getStatusCode()
Returns the status code for the request.
|
String |
getStatusText()
Returns the status text for the request.
|
Uri |
getUri()
Return the request
Uri . |
boolean |
hasResponseBody()
Return true if the response's body has been computed by an
AsyncHandler . |
boolean |
hasResponseHeaders()
Return true if the response's headers has been computed by an
AsyncHandler It will return false if the either
AsyncHandler.onStatusReceived(HttpResponseStatus) or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.State.ABORT |
boolean |
hasResponseStatus()
Return true if the response's status has been computed by an
AsyncHandler |
boolean |
isRedirected()
Return true if the response redirects to another object.
|
String |
toString()
Subclasses SHOULD implement toString() in a way that identifies the response for logging.
|
int getStatusCode()
String getStatusText()
byte[] getResponseBodyAsBytes()
ByteBuffer getResponseBodyAsByteBuffer()
InputStream getResponseBodyAsStream()
String getResponseBody(Charset charset)
charset
- the charset to use when decoding the streamString getResponseBody()
Uri getUri()
Uri
. Note that if the request got redirected, the value of the Uri
will be the last valid redirect url.Uri
.String getContentType()
String getHeader(String name)
name
- the header nameList<String> getHeaders(String name)
List
of the response header value.name
- the header nameio.netty.handler.codec.http.HttpHeaders getHeaders()
boolean isRedirected()
String toString()
boolean hasResponseStatus()
AsyncHandler
AsyncHandler
boolean hasResponseHeaders()
AsyncHandler
It will return false if the either
AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders)
returned AsyncHandler.State.ABORT
AsyncHandler
boolean hasResponseBody()
AsyncHandler
. It will return false if the either AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders)
returned AsyncHandler.State.ABORT
AsyncHandler
SocketAddress getRemoteAddress()
null
if asynchronous provider is unable to provide the remote addressSocketAddress getLocalAddress()
null
if asynchronous provider is unable to provide the local addressCopyright © 2015. All Rights Reserved.