Package com.ning.http.client
Class ResponseBase
java.lang.Object
com.ning.http.client.ResponseBase
- All Implemented Interfaces:
Response
- Direct Known Subclasses:
GrizzlyResponse
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ning.http.client.Response
Response.ResponseBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<HttpResponseBodyPart>protected final HttpResponseHeadersprotected final HttpResponseStatus -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResponseBase(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts) -
Method Summary
Modifier and TypeMethodDescriptionprotected CharsetcalculateCharset(String charset) final StringReturn the content-type header value.Return the list ofCookie.final StringReturn the response headergetHeaders(String name) Return aListof the response header value.final intReturns the status code for the request.final StringReturns the status text for the request.final UrigetUri()Return the requestUri.booleanReturn true if the response's body has been computed by anAsyncHandler.booleanReturn true if the response's headers has been computed by anAsyncHandlerIt will return false if the eitherAsyncHandler.onStatusReceived(HttpResponseStatus)orAsyncHandler.onHeadersReceived(HttpResponseHeaders)returnedAsyncHandler.STATE.ABORTbooleanReturn true if the response's status has been computed by anAsyncHandlerfinal booleanReturn 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, waitMethods inherited from interface com.ning.http.client.Response
getResponseBody, getResponseBody, getResponseBodyAsByteBuffer, getResponseBodyAsBytes, getResponseBodyAsStream, getResponseBodyExcerpt, getResponseBodyExcerpt, toString
-
Field Details
-
status
-
headers
-
bodyParts
-
-
Constructor Details
-
ResponseBase
protected ResponseBase(HttpResponseStatus status, HttpResponseHeaders headers, List<HttpResponseBodyPart> bodyParts)
-
-
Method Details
-
buildCookies
-
calculateCharset
-
getStatusCode
public final int getStatusCode()Description copied from interface:ResponseReturns the status code for the request.- Specified by:
getStatusCodein interfaceResponse- Returns:
- The status code
-
getStatusText
Description copied from interface:ResponseReturns the status text for the request.- Specified by:
getStatusTextin interfaceResponse- Returns:
- The status text
-
getUri
Description copied from interface:Response -
getContentType
Description copied from interface:ResponseReturn the content-type header value.- Specified by:
getContentTypein interfaceResponse- Returns:
- the content-type header value.
-
getHeader
Description copied from interface:ResponseReturn the response header -
getHeaders
Description copied from interface:ResponseReturn aListof the response header value.- Specified by:
getHeadersin interfaceResponse- Returns:
- the response header
-
getHeaders
- Specified by:
getHeadersin interfaceResponse
-
isRedirected
public final boolean isRedirected()Description copied from interface:ResponseReturn true if the response redirects to another object.- Specified by:
isRedirectedin interfaceResponse- Returns:
- True if the response redirects to another object.
-
getCookies
Description copied from interface:ResponseReturn the list ofCookie.- Specified by:
getCookiesin interfaceResponse
-
hasResponseStatus
public boolean hasResponseStatus()Description copied from interface:ResponseReturn true if the response's status has been computed by anAsyncHandler- Specified by:
hasResponseStatusin interfaceResponse- Returns:
- true if the response's status has been computed by an
AsyncHandler
-
hasResponseHeaders
public boolean hasResponseHeaders()Description copied from interface:ResponseReturn true if the response's headers has been computed by anAsyncHandlerIt will return false if the eitherAsyncHandler.onStatusReceived(HttpResponseStatus)orAsyncHandler.onHeadersReceived(HttpResponseHeaders)returnedAsyncHandler.STATE.ABORT- Specified by:
hasResponseHeadersin interfaceResponse- Returns:
- true if the response's headers has been computed by an
AsyncHandler
-
hasResponseBody
public boolean hasResponseBody()Description copied from interface:ResponseReturn true if the response's body has been computed by anAsyncHandler. It will return false if the eitherAsyncHandler.onStatusReceived(HttpResponseStatus)orAsyncHandler.onHeadersReceived(HttpResponseHeaders)returnedAsyncHandler.STATE.ABORT- Specified by:
hasResponseBodyin interfaceResponse- Returns:
- true if the response's body has been computed by an
AsyncHandler
-