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 a
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.HeadersContent-Length header.contentLength in interface ClientResponse.Headerspublic Optional<MediaType> contentType()
ClientResponse.HeadersContent-Type header.contentType in interface ClientResponse.Headerspublic List<String> header(String headerName)
ClientResponse.HeadersReturn an empty list if no header values are found.
header in interface ClientResponse.HeadersheaderName - the header namepublic HttpHeaders asHttpHeaders()
ClientResponse.HeadersHttpHeaders instance.asHttpHeaders in interface ClientResponse.Headers