|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.http.client.providers.grizzly.GrizzlyResponse
public class GrizzlyResponse
HttpResponseBodyPart implementation using the Grizzly 2.0 HTTP client
codec.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.ning.http.client.Response |
|---|
Response.ResponseBuilder |
| Constructor Summary | |
|---|---|
GrizzlyResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
Collection<HttpResponseBodyPart> bodyParts)
|
|
| Method Summary | |
|---|---|
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. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.ning.http.client.Response |
|---|
toString |
| Constructor Detail |
|---|
public GrizzlyResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
Collection<HttpResponseBodyPart> bodyParts)
| Method Detail |
|---|
public int getStatusCode()
getStatusCode in interface Responsepublic String getStatusText()
getStatusText in interface Response
public InputStream getResponseBodyAsStream()
throws IOException
getResponseBodyAsStream in interface ResponseIOException
public String getResponseBodyExcerpt(int maxLength,
String charset)
throws IOException
getResponseBodyExcerpt in interface ResponsemaxLength - The maximum number of bytes to readcharset - the charset to use when decoding the stream
IOException
public String getResponseBody(String charset)
throws IOException
getResponseBody in interface Responsecharset - the charset to use when decoding the stream
IOException
public String getResponseBodyExcerpt(int maxLength)
throws IOException
getResponseBodyExcerpt in interface ResponsemaxLength - The maximum number of bytes to read
IOException
public String getResponseBody()
throws IOException
getResponseBody in interface ResponseIOException
public byte[] getResponseBodyAsBytes()
throws IOException
getResponseBodyAsBytes in interface ResponseIOException
public URI getUri()
throws MalformedURLException
URI. Note that if the request got redirected, the value of the URI will be
the last valid redirect url.
getUri in interface ResponseURI.
MalformedURLExceptionpublic String getContentType()
getContentType in interface Responsepublic String getHeader(String name)
getHeader in interface Responsepublic List<String> getHeaders(String name)
List of the response header value.
getHeaders in interface Responsepublic FluentCaseInsensitiveStringsMap getHeaders()
getHeaders in interface Responsepublic boolean isRedirected()
isRedirected in interface Responsepublic List<Cookie> getCookies()
Cookie.
getCookies in interface Responsepublic boolean hasResponseStatus()
AsyncHandler
hasResponseStatus in interface ResponseAsyncHandlerpublic boolean hasResponseHeaders()
AsyncHandler It will return false if the
either AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE.ABORT
hasResponseHeaders in interface ResponseAsyncHandlerpublic boolean hasResponseBody()
AsyncHandler. It will return false if the
either AsyncHandler.onStatusReceived(HttpResponseStatus)
or AsyncHandler.onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE.ABORT
hasResponseBody in interface ResponseAsyncHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||