Package org.eclipse.jetty.client
Class HttpResponse
- java.lang.Object
-
- org.eclipse.jetty.client.HttpResponse
-
-
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
Constructors Constructor Description HttpResponse(Request request, java.util.List<Response.ResponseListener> listeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort(java.lang.Throwable cause)
Attempts to abort the receive of this response.HttpFields
getHeaders()
<T extends Response.ResponseListener>
java.util.List<T>getListeners(java.lang.Class<T> type)
java.lang.String
getReason()
Request
getRequest()
int
getStatus()
HttpFields
getTrailers()
HttpVersion
getVersion()
HttpResponse
reason(java.lang.String reason)
HttpResponse
status(int status)
java.lang.String
toString()
HttpResponse
trailer(HttpField trailer)
HttpResponse
version(HttpVersion version)
-
-
-
Constructor Detail
-
HttpResponse
public HttpResponse(Request request, java.util.List<Response.ResponseListener> listeners)
-
-
Method Detail
-
getRequest
public Request getRequest()
- Specified by:
getRequest
in interfaceResponse
- Returns:
- the request associated with this response
-
getVersion
public HttpVersion getVersion()
- Specified by:
getVersion
in interfaceResponse
- Returns:
- the HTTP version of this response, such as "HTTP/1.1"
-
version
public HttpResponse version(HttpVersion version)
-
getStatus
public int getStatus()
-
status
public HttpResponse status(int status)
-
getReason
public java.lang.String getReason()
- Specified by:
getReason
in interfaceResponse
- Returns:
- the HTTP reason associated to the
Response.getStatus()
-
reason
public HttpResponse reason(java.lang.String reason)
-
getHeaders
public HttpFields getHeaders()
- Specified by:
getHeaders
in interfaceResponse
- Returns:
- the headers of this response
-
getListeners
public <T extends Response.ResponseListener> java.util.List<T> getListeners(java.lang.Class<T> type)
- Specified by:
getListeners
in interfaceResponse
- Type Parameters:
T
- the type of class- Parameters:
type
- the listener class- Returns:
- the response listener passed to
Request.send(org.eclipse.jetty.client.api.Response.CompleteListener)
-
getTrailers
public HttpFields getTrailers()
-
trailer
public HttpResponse trailer(HttpField trailer)
-
abort
public boolean abort(java.lang.Throwable cause)
Description copied from interface:Response
Attempts to abort the receive of this response.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-