Response.ResponseBuilder
Modifier and Type | Method and Description |
---|---|
Document |
getBodyAsXML() |
String |
getContentType()
Return the content-type header value.
|
List<io.netty.handler.codec.http.cookie.Cookie> |
getCookies() |
String |
getHeader(CharSequence name) |
io.netty.handler.codec.http.HttpHeaders |
getHeaders() |
List<String> |
getHeaders(CharSequence name)
Return a
List of the response header value. |
SocketAddress |
getLocalAddress()
Get the local address that the client initiated the request from.
|
SocketAddress |
getRemoteAddress()
Get the remote address that the client initiated the 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(HttpHeaders) 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.
|
public int getStatusCode()
Response
getStatusCode
in interface Response
public String getStatusText()
Response
getStatusText
in interface Response
public byte[] getResponseBodyAsBytes()
Response
getResponseBodyAsBytes
in interface Response
public ByteBuffer getResponseBodyAsByteBuffer()
Response
getResponseBodyAsByteBuffer
in interface Response
public InputStream getResponseBodyAsStream()
Response
getResponseBodyAsStream
in interface Response
public String getResponseBody()
Response
getResponseBody
in interface Response
public String getResponseBody(Charset charset)
Response
getResponseBody
in interface Response
charset
- the charset to use when decoding the streampublic String getContentType()
Response
getContentType
in interface Response
public String getHeader(CharSequence name)
public List<String> getHeaders(CharSequence name)
Response
List
of the response header value.getHeaders
in interface Response
name
- the header namepublic io.netty.handler.codec.http.HttpHeaders getHeaders()
getHeaders
in interface Response
public boolean isRedirected()
Response
isRedirected
in interface Response
public List<io.netty.handler.codec.http.cookie.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(HttpHeaders)
returned AsyncHandler.State.ABORT
hasResponseHeaders
in interface Response
AsyncHandler
public boolean hasResponseBody()
Response
AsyncHandler
.
It will return false if:
AsyncHandler.onStatusReceived(HttpResponseStatus)
returned AsyncHandler.State.ABORT
AsyncHandler.onHeadersReceived(HttpHeaders)
returned AsyncHandler.State.ABORT
hasResponseBody
in interface Response
AsyncHandler
to new empty bytespublic SocketAddress getRemoteAddress()
Response
getRemoteAddress
in interface Response
null
if asynchronous provider is unable to provide the remote addresspublic SocketAddress getLocalAddress()
Response
getLocalAddress
in interface Response
null
if asynchronous provider is unable to provide the local addresspublic Document getBodyAsXML()
Copyright © 2019. All rights reserved.