Response.ResponseBuilder
Constructor and Description |
---|
NettyResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
java.util.List<HttpResponseBodyPart> bodyParts) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Return the content-type header value.
|
java.util.List<Cookie> |
getCookies() |
java.lang.String |
getHeader(java.lang.String name) |
io.netty.handler.codec.http.HttpHeaders |
getHeaders() |
java.util.List<java.lang.String> |
getHeaders(java.lang.String name)
Return a
List of the response header value. |
java.net.SocketAddress |
getLocalAddress()
Get local address client initiated request from.
|
java.net.SocketAddress |
getRemoteAddress()
Get remote address client initiated request to.
|
java.lang.String |
getResponseBody()
Return the entire response body as a String.
|
java.lang.String |
getResponseBody(java.nio.charset.Charset charset)
Return the entire response body as a String.
|
java.nio.ByteBuffer |
getResponseBodyAsByteBuffer()
Return the entire response body as a ByteBuffer.
|
byte[] |
getResponseBodyAsBytes()
Return the entire response body as a byte[].
|
java.io.InputStream |
getResponseBodyAsStream()
Returns an input stream for the response body.
|
int |
getStatusCode()
Returns the status code for the request.
|
java.lang.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.
|
java.lang.String |
toString()
Subclasses SHOULD implement toString() in a way that identifies the response for logging.
|
public NettyResponse(HttpResponseStatus status, HttpResponseHeaders headers, java.util.List<HttpResponseBodyPart> bodyParts)
public final int getStatusCode()
Response
getStatusCode
in interface Response
public final java.lang.String getStatusText()
Response
getStatusText
in interface Response
public java.net.SocketAddress getRemoteAddress()
Response
getRemoteAddress
in interface Response
null
if asynchronous provider is unable to provide the remote addresspublic java.net.SocketAddress getLocalAddress()
Response
getLocalAddress
in interface Response
null
if asynchronous provider is unable to provide the local addresspublic final java.lang.String getContentType()
Response
getContentType
in interface Response
public final java.lang.String getHeader(java.lang.String name)
public final java.util.List<java.lang.String> getHeaders(java.lang.String name)
Response
List
of the response header value.getHeaders
in interface Response
name
- the header namepublic final io.netty.handler.codec.http.HttpHeaders getHeaders()
getHeaders
in interface Response
public final boolean isRedirected()
Response
isRedirected
in interface Response
public java.util.List<Cookie> getCookies()
getCookies
in interface Response
Cookie
.public boolean hasResponseStatus()
Response
AsyncHandler
hasResponseStatus
in interface Response
AsyncHandler
public boolean hasResponseHeaders()
Response
AsyncHandler
It will return false if the either
AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders)
returned AsyncHandler.State.ABORT
hasResponseHeaders
in interface Response
AsyncHandler
public boolean hasResponseBody()
Response
AsyncHandler
. It will return false if the either AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders)
returned AsyncHandler.State.ABORT
hasResponseBody
in interface Response
AsyncHandler
public byte[] getResponseBodyAsBytes()
Response
getResponseBodyAsBytes
in interface Response
public java.nio.ByteBuffer getResponseBodyAsByteBuffer()
Response
getResponseBodyAsByteBuffer
in interface Response
public java.lang.String getResponseBody()
Response
getResponseBody
in interface Response
public java.lang.String getResponseBody(java.nio.charset.Charset charset)
Response
getResponseBody
in interface Response
charset
- the charset to use when decoding the streampublic java.io.InputStream getResponseBodyAsStream()
Response
getResponseBodyAsStream
in interface Response
public java.lang.String toString()
Response
Copyright © 2017. All Rights Reserved.