java.lang.Object
org.eclipse.jetty.client.HttpContentResponse
- All Implemented Interfaces:
ContentResponse,Response
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Response
Response.AsyncContentListener, Response.BeginListener, Response.CompleteListener, Response.ContentListener, Response.DemandedContentListener, Response.FailureListener, Response.HeaderListener, Response.HeadersListener, Response.Listener, Response.ResponseListener, Response.SuccessListener -
Constructor Summary
ConstructorsConstructorDescriptionHttpContentResponse(Response response, byte[] content, String mediaType, String encoding) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAttempts to abort the receive of this response.byte[]org.eclipse.jetty.http.HttpFields<T extends Response.ResponseListener>
List<T>getListeners(Class<T> listenerClass) intorg.eclipse.jetty.http.HttpFieldsorg.eclipse.jetty.http.HttpVersiontoString()
-
Constructor Details
-
HttpContentResponse
-
-
Method Details
-
getRequest
- Specified by:
getRequestin interfaceResponse- Returns:
- the request associated with this response
-
getListeners
- Specified by:
getListenersin interfaceResponse- Type Parameters:
T- the type of class- Parameters:
listenerClass- the listener class- Returns:
- the response listener passed to
Request.send(org.eclipse.jetty.client.api.Response.CompleteListener)
-
getVersion
public org.eclipse.jetty.http.HttpVersion getVersion()- Specified by:
getVersionin interfaceResponse- Returns:
- the HTTP version of this response, such as "HTTP/1.1"
-
getStatus
public int getStatus() -
getReason
- Specified by:
getReasonin interfaceResponse- Returns:
- the HTTP reason associated to the
Response.getStatus()
-
getHeaders
public org.eclipse.jetty.http.HttpFields getHeaders()- Specified by:
getHeadersin interfaceResponse- Returns:
- the headers of this response
-
getTrailers
public org.eclipse.jetty.http.HttpFields getTrailers()- Specified by:
getTrailersin interfaceResponse- Returns:
- the trailers of this response
-
abort
Description copied from interface:ResponseAttempts to abort the receive of this response. -
getMediaType
- Specified by:
getMediaTypein interfaceContentResponse- Returns:
- the media type of the content, such as "text/html" or "application/octet-stream"
-
getEncoding
- Specified by:
getEncodingin interfaceContentResponse- Returns:
- the encoding of the content, such as "UTF-8"
-
getContent
public byte[] getContent()- Specified by:
getContentin interfaceContentResponse- Returns:
- the response content
-
getContentAsString
- Specified by:
getContentAsStringin interfaceContentResponse- Returns:
- the response content as a string, decoding the bytes using the charset
provided by the
Content-Typeheader, if any, or UTF-8.
-
toString
-