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()
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. 
 | 
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. 
 | 
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 request for logging. 
 | 
int getStatusCode()
String getStatusText()
InputStream getResponseBodyAsStream() throws IOException
IOExceptionString getResponseBodyExcerpt(int maxLength, String charset) throws IOException
maxLength - The maximum number of bytes to readcharset - the charset to use when decoding the streamIOExceptionString getResponseBody(String charset) throws IOException
charset - the charset to use when decoding the streamIOExceptionString getResponseBodyExcerpt(int maxLength) throws IOException
maxLength - The maximum number of bytes to readIOExceptionString getResponseBody() throws IOException
IOExceptionURI getUri() throws MalformedURLException
URI. Note that if the request got redirected, the value of the URI will be
 the last valid redirect url.URI.MalformedURLExceptionString getContentType()
List<String> getHeaders(String name)
List of the response header value.FluentCaseInsensitiveStringsMap getHeaders()
boolean isRedirected()
String toString()
boolean hasResponseStatus()
AsyncHandlerAsyncHandlerboolean hasResponseHeaders()
AsyncHandler It will return false if the
 either AsyncHandler.onStatusReceived(HttpResponseStatus)
 or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE.ABORTAsyncHandlerboolean hasResponseBody()
AsyncHandler. It will return false if the
 either AsyncHandler.onStatusReceived(HttpResponseStatus)
 or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE.ABORTAsyncHandlerCopyright © 2015. All rights reserved.