public interface HttpResponse
| Modifier and Type | Method and Description |
|---|---|
<T> Header<T> |
firstHeader(HeaderType<T> headerType)
Returns the first
Header of the given HeaderType. |
<T> boolean |
hasHeader(HeaderType<T> headerType)
Checks whether the response contains at least one header of the given
HeaderType. |
<T> java.util.Iterator<Header<T>> |
headers(HeaderType<T> headerType)
|
java.net.URI |
requestUri()
Returns the
URI the request was originally sent to. |
HttpResponseEntity |
responseEntity()
Returns an
HttpResponseEntity representing the data in the response. |
java.net.URI |
responseUri()
Returns the
URI of the server that handled the instance. |
HttpStatus |
status()
Returns the status of the response.
|
HttpStatus status()
HttpStatus<T> boolean hasHeader(HeaderType<T> headerType)
HeaderType.headerType - The HeaderType of the header to check.true if there is at least one such header, false otherwise.<T> Header<T> firstHeader(HeaderType<T> headerType) throws java.util.NoSuchElementException
Header of the given HeaderType. Use hasHeader(HeaderType) before you call this to make sure such a
Header actually exists.headerType - The HeaderType of the Header to return.Header of the given type.java.util.NoSuchElementException - if no such Header exists.<T> java.util.Iterator<Header<T>> headers(HeaderType<T> headerType)
headerType - The HeaderType of the Headers to return.Iterator of Headers, may be empty (not null).HttpResponseEntity responseEntity()
HttpResponseEntity representing the data in the response.HttpResponseEntity.java.net.URI requestUri()
URI the request was originally sent to.responseUri()java.net.URI responseUri()
URI of the server that handled the instance. If no redirects have been followed this equals the URI passed to the execute methods of
HttpRequestExecutor otherwise it's the URI of the last location that didn't return a redirect.requestUri()