Response.ResponseBuilder| Constructor and Description |
|---|
ApacheResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
List<HttpResponseBodyPart> bodyParts) |
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType()
Return the content-type header value.
|
List<Cookie> |
getCookies()
Return the list of
Cookie. |
String |
getHeader(String name)
Return the response header
|
FluentCaseInsensitiveStringsMap |
getHeaders() |
List<String> |
getHeaders(String name)
Return a
List of the response header value. |
String |
getResponseBody()
Return the entire response body as a String.
|
String |
getResponseBody(String 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.
|
String |
getResponseBodyExcerpt(int maxLength)
Returns the first maxLength bytes of the response body as a string.
|
String |
getResponseBodyExcerpt(int maxLength,
String charset)
Returns the first maxLength bytes of the response body as a string.
|
int |
getStatusCode()
Returns the status code for the request.
|
String |
getStatusText()
Returns the status text for the request.
|
UriComponents |
getUri()
Return the request
UriComponents. |
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.
|
public ApacheResponse(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts)
public int getStatusCode()
ResponsegetStatusCode in interface Responsepublic String getStatusText()
ResponsegetStatusText in interface Responsepublic byte[] getResponseBodyAsBytes()
throws IOException
ResponsegetResponseBodyAsBytes in interface ResponseIOExceptionpublic ByteBuffer getResponseBodyAsByteBuffer() throws IOException
ResponsegetResponseBodyAsByteBuffer in interface ResponseIOExceptionpublic String getResponseBody() throws IOException
ResponsegetResponseBody in interface ResponseIOExceptionpublic String getResponseBody(String charset) throws IOException
ResponsegetResponseBody in interface Responsecharset - the charset to use when decoding the streamIOExceptionpublic InputStream getResponseBodyAsStream() throws IOException
ResponsegetResponseBodyAsStream in interface ResponseIOExceptionpublic String getResponseBodyExcerpt(int maxLength) throws IOException
ResponsegetResponseBodyExcerpt in interface ResponsemaxLength - The maximum number of bytes to readIOExceptionpublic String getResponseBodyExcerpt(int maxLength, String charset) throws IOException
ResponsegetResponseBodyExcerpt in interface ResponsemaxLength - The maximum number of bytes to readcharset - the charset to use when decoding the streamIOExceptionpublic UriComponents getUri()
ResponseUriComponents. Note that if the request got redirected, the value of the UriComponents will be
the last valid redirect url.getUri in interface ResponseUriComponents.public String getContentType()
ResponsegetContentType in interface Responsepublic String getHeader(String name)
Responsepublic List<String> getHeaders(String name)
ResponseList of the response header value.getHeaders in interface Responsepublic FluentCaseInsensitiveStringsMap getHeaders()
getHeaders in interface Responsepublic boolean isRedirected()
ResponseisRedirected in interface Responsepublic List<Cookie> getCookies()
ResponseCookie.getCookies in interface Responsepublic boolean hasResponseStatus()
AsyncHandlerhasResponseStatus in interface ResponseAsyncHandlerpublic boolean hasResponseHeaders()
AsyncHandler It will return false if the
either AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE.ABORThasResponseHeaders in interface ResponseAsyncHandlerpublic boolean hasResponseBody()
AsyncHandler. It will return false if the
either AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE.ABORThasResponseBody in interface ResponseAsyncHandlerCopyright © 2014. All Rights Reserved.