|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.http.client.providers.netty.NettyAsyncResponse
public class NettyAsyncResponse
Wrapper around the Response API.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.ning.http.client.Response |
|---|
Response.ResponseBuilder |
| Constructor Summary | |
|---|---|
NettyAsyncResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
java.util.Collection<HttpResponseBodyPart> bodyParts)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
Return the content-type header value. |
java.util.List<Cookie> |
getCookies()
Return the list of Cookie. |
java.lang.String |
getHeader(java.lang.String name)
Return the response header |
FluentCaseInsensitiveStringsMap |
getHeaders()
|
java.util.List<java.lang.String> |
getHeaders(java.lang.String name)
Return a List of the response header value. |
java.lang.String |
getResponseBody()
Return the entire response body as a String. |
java.io.InputStream |
getResponseBodyAsStream()
Returns an input stream for the response body. |
java.lang.String |
getResponseBodyExcerpt(int maxLength)
Returns the first maxLength bytes of the response body as a string. |
int |
getStatusCode()
Returns the status code for the request. |
java.lang.String |
getStatusText()
Returns the status text for the request. |
java.net.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 NettyAsyncResponse(HttpResponseStatus status,
HttpResponseHeaders headers,
java.util.Collection<HttpResponseBodyPart> bodyParts)
| Method Detail |
|---|
public int getStatusCode()
Response
getStatusCode in interface Responsepublic java.lang.String getStatusText()
Response
getStatusText in interface Response
public java.lang.String getResponseBody()
throws java.io.IOException
Response
getResponseBody in interface Responsejava.io.IOException
public java.io.InputStream getResponseBodyAsStream()
throws java.io.IOException
Response
getResponseBodyAsStream in interface Responsejava.io.IOException
public java.lang.String getResponseBodyExcerpt(int maxLength)
throws java.io.IOException
Response
getResponseBodyExcerpt in interface ResponsemaxLength - The maximum number of bytes to read
java.io.IOException
public java.net.URI getUri()
throws java.net.MalformedURLException
ResponseURI. Note that if the request got redirected, the value of the URI will be
the last valid redirect url.
getUri in interface ResponseURI.
java.net.MalformedURLExceptionpublic java.lang.String getContentType()
Response
getContentType in interface Responsepublic java.lang.String getHeader(java.lang.String name)
Response
getHeader in interface Responsepublic java.util.List<java.lang.String> getHeaders(java.lang.String name)
ResponseList of the response header value.
getHeaders in interface Responsepublic FluentCaseInsensitiveStringsMap getHeaders()
getHeaders in interface Responsepublic boolean isRedirected()
Response
isRedirected in interface Responsepublic java.util.List<Cookie> getCookies()
ResponseCookie.
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 | |||||||||