public final class DefaultHttpResponse extends AbstractHttpResponse implements HttpResponse
HttpResponse.| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(AbstractHttpResponse o)
Ensure that given object o can be equal to this.
|
boolean |
equals(Object o) |
HttpHeader |
getHeader(String name)
Get header from HTTP response (if header is missing,
null will be returned). |
Collection<HttpHeader> |
getHeaders()
Get the list of headers.
|
int |
hashCode() |
static DefaultHttpResponse |
of(long duration,
int status,
String body,
Collection<HttpHeader> headers)
Create a default HTTP Response from given values.
|
protected String |
readResponseBody()
Read HTTP Response _body as a
String. |
int |
status()
Http status code.
|
String |
toString() |
body, containsHeader, getCacheControl, getContentEncoding, getContentSecurityPolicy, getContentType, getCookie, getCookies, getETag, getLastModified, getLocation, getRequestDuration, getRequestDurationInMillis, getStrictTransportSecurity, getXContentSecurityPolicy, getXContentTypeOptions, getXWebkitCSP, getXXSSProtectionclone, finalize, getClass, notify, notifyAll, wait, wait, waitbody, containsHeader, getCacheControl, getContentEncoding, getContentSecurityPolicy, getContentType, getCookie, getCookies, getETag, getLastModified, getLocation, getRequestDuration, getRequestDurationInMillis, getStrictTransportSecurity, getXContentSecurityPolicy, getXContentTypeOptions, getXWebkitCSP, getXXSSProtectionpublic static DefaultHttpResponse of(long duration, int status, String body, Collection<HttpHeader> headers)
duration - Request-Response duration.status - The response status code.body - The response body.headers - The response headers.public int status()
HttpResponsestatus in interface HttpResponseprotected String readResponseBody()
AbstractHttpResponseString.readResponseBody in class AbstractHttpResponsepublic Collection<HttpHeader> getHeaders()
HttpResponsegetHeaders in interface HttpResponsepublic HttpHeader getHeader(String name)
HttpResponsenull will be returned).getHeader in interface HttpResponsename - Header name.null if header is not in http response.public boolean equals(Object o)
equals in class AbstractHttpResponsepublic int hashCode()
hashCode in class AbstractHttpResponseprotected boolean canEqual(AbstractHttpResponse o)
AbstractHttpResponsecanEqual in class AbstractHttpResponseo - The HTTP Response.Copyright © 2018. All rights reserved.