Package org.eclipse.jetty.client
Class HttpContentResponse
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[]Returns the headers of this response.<T extends Response.ResponseListener>
List<T>getListeners(Class<T> listenerClass) inttoString()
-
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
- 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
Description copied from interface:ResponseReturns the headers of this response.
Some headers sent by the server may not be present, or be present but modified, while the content is being processed. A typical example is the
Content-Lengthheader when the content is sent compressed by the server and automatically decompressed by the client: theContent-Lengthheader will be removed.Similarly, the
Content-Encodingheader may be removed or modified, as the content is decoded by the client.- Specified by:
getHeadersin interfaceResponse- Returns:
- the headers 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
-