public interface HttpResponse
| Modifier and Type | Method and Description |
|---|---|
String |
body()
Http response body.
|
boolean |
containsHeader(String name)
Check that given header is available.
|
HttpHeader |
getCacheControl()
Get
Cache-Control header from http response. |
HttpHeader |
getContentEncoding()
Get
Content-Encoding header from http response. |
HttpHeader |
getContentSecurityPolicy()
Get
Content-Security-Policy header from http response. |
HttpHeader |
getContentType()
Get
Content-Type header from http response. |
Cookie |
getCookie(String name)
Get cookie by its name (if cookie is missing,
null is returned). |
List<Cookie> |
getCookies()
Get all cookies sent by server.
|
HttpHeader |
getETag()
Get
ETag header from http response. |
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.
|
HttpHeader |
getLastModified()
Get
Last-Modified header from http response. |
HttpHeader |
getLocation()
Get
Location header from http response. |
long |
getRequestDuration()
Get duration of request execution in nano seconds.
|
long |
getRequestDurationInMillis()
Get duration of request execution in milli seconds (shortcut for
getRequestDuration() / 100). |
HttpHeader |
getStrictTransportSecurity()
Get
Strict-Transport-Security header from http response. |
HttpHeader |
getXContentSecurityPolicy()
Get
X-Content-Security-Policy header from http response: this header was initially an experimental
header implemented in Firefox. |
HttpHeader |
getXContentTypeOptions()
Get
X-Content-Type-Options header from http response. |
HttpHeader |
getXWebkitCSP()
Get
X-Webkit-CSP header from http response: this header was initially an experimental header implemented
in Webkit browser (Chrome and Safari). |
HttpHeader |
getXXSSProtection()
Get
X-XSS-Protection header from http response. |
int |
status()
Http status code.
|
long getRequestDuration()
long getRequestDurationInMillis()
getRequestDuration() / 100).getRequestDuration()int status()
String body()
Collection<HttpHeader> getHeaders()
boolean containsHeader(String name)
name - Header name.true if header is in response, false otherwise.HttpHeader getHeader(String name)
null will be returned).name - Header name.null if header is not in http response.NullPointerException - If name is null.Cookie getCookie(String name)
null is returned).name - Cookie name.HttpHeaders.SET_COOKIE,
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie,
https://tools.ietf.org/html/rfc6265#section-4.1HttpHeader getETag()
ETag header from http response.getHeader(String),
HttpHeaders.ETAG,
https://tools.ietf.org/html/rfc7232#section-2.3HttpHeader getContentType()
Content-Type header from http response.getHeader(String),
HttpHeaders.CONTENT_TYPE,
https://www.w3.org/Protocols/rfc1341/4_Content-Type.htmlHttpHeader getContentEncoding()
Content-Encoding header from http response.HttpHeaders.CONTENT_ENCODING,
https://tools.ietf.org/html/rfc7231#section-3.1.2.2HttpHeader getLocation()
Location header from http response.getHeader(String),
HttpHeaders.LOCATION,
https://tools.ietf.org/html/rfc7231#section-7.1.2HttpHeader getCacheControl()
Cache-Control header from http response.getHeader(String),
HttpHeaders.CACHE_CONTROL,
https://tools.ietf.org/html/rfc7234#section-5.2HttpHeader getLastModified()
Last-Modified header from http response.getHeader(String),
HttpHeaders.LAST_MODIFIED,
https://tools.ietf.org/html/rfc7232#section-2.2HttpHeader getStrictTransportSecurity()
Strict-Transport-Security header from http response.getHeader(String),
HttpHeaders.STRICT_TRANSPORT_SECURITY,
https://tools.ietf.org/html/rfc6797HttpHeader getContentSecurityPolicy()
Content-Security-Policy header from http response.getHeader(String),
HttpHeaders.CONTENT_SECURITY_POLICY,
https://www.w3.org/TR/2011/WD-CSP-20111129/,
https://content-security-policy.com/HttpHeader getXContentSecurityPolicy()
X-Content-Security-Policy header from http response: this header was initially an experimental
header implemented in Firefox.getHeader(String),
HttpHeaders.X_CONTENT_SECURITY_POLICY,
https://www.w3.org/TR/2011/WD-CSP-20111129/,
https://content-security-policy.com/HttpHeader getXWebkitCSP()
X-Webkit-CSP header from http response: this header was initially an experimental header implemented
in Webkit browser (Chrome and Safari).getHeader(String),
HttpHeaders.X_WEBKIT_CSP,
https://www.w3.org/TR/2011/WD-CSP-20111129/,
https://content-security-policy.com/HttpHeader getXContentTypeOptions()
X-Content-Type-Options header from http response.getHeader(String),
HttpHeaders.X_CONTENT_TYPE_OPTIONS,
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-OptionsHttpHeader getXXSSProtection()
X-XSS-Protection header from http response.getHeader(String),
HttpHeaders.X_XSS_PROTECTION,
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-ProtectionCopyright © 2018. All rights reserved.