public static class ClientResponseWrapper.HeadersWrapper extends java.lang.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. |
java.util.OptionalLong |
contentLength()
Return the length of the body in bytes, as specified by the
Content-Length header. |
java.util.Optional<MediaType> |
contentType()
Return the media type of the body, as specified
by the
Content-Type header. |
java.util.List<java.lang.String> |
header(java.lang.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 java.util.OptionalLong contentLength()
ClientResponse.HeadersContent-Length header.contentLength in interface ClientResponse.Headerspublic java.util.Optional<MediaType> contentType()
ClientResponse.HeadersContent-Type header.contentType in interface ClientResponse.Headerspublic java.util.List<java.lang.String> header(java.lang.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