public static class ClientResponseWrapper.HeadersWrapper extends Object implements ClientResponse.Headers
Headers
interface that can be subclassed
to adapt the headers in a
exchange filter function
.
All methods default to calling through to the wrapped request.Constructor and Description |
---|
HeadersWrapper(ClientResponse.Headers headers)
Create a new
HeadersWrapper that wraps the given request. |
Modifier and Type | Method and Description |
---|---|
HttpHeaders |
asHttpHeaders()
Return the headers as an
HttpHeaders instance. |
OptionalLong |
contentLength()
Return the length of the body in bytes, as specified by the
Content-Length header. |
Optional<MediaType> |
contentType()
Return the media type of the body, as specified
by the
Content-Type header. |
List<String> |
header(String headerName)
Return the header value(s), if any, for the header of the given name.
|
public HeadersWrapper(ClientResponse.Headers headers)
HeadersWrapper
that wraps the given request.headers
- the headers to wrappublic OptionalLong contentLength()
ClientResponse.Headers
Content-Length
header.contentLength
in interface ClientResponse.Headers
public Optional<MediaType> contentType()
ClientResponse.Headers
Content-Type
header.contentType
in interface ClientResponse.Headers
public List<String> header(String headerName)
ClientResponse.Headers
Return an empty list if no header values are found.
header
in interface ClientResponse.Headers
headerName
- the header namepublic HttpHeaders asHttpHeaders()
ClientResponse.Headers
HttpHeaders
instance.asHttpHeaders
in interface ClientResponse.Headers