org.springframework.web.reactive.function.client.support

## Class ClientResponseWrapper.HeadersWrapper

- java.lang.Object
- - org.springframework.web.reactive.function.client.support.ClientResponseWrapper.HeadersWrapper

- All Implemented Interfaces:
    ClientResponse.Headers
  Enclosing class:
    ClientResponseWrapper

      public static class ClientResponseWrapper.HeadersWrapper
      extends Object
      implements ClientResponse.Headers

  Implementation of the `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 Summary

    Constructors
    Constructor and Description
    `HeadersWrapper(ClientResponse.Headers headers)` Create a new `HeadersWrapper` that wraps the given request.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HeadersWrapper

          public HeadersWrapper(ClientResponse.Headers headers)

      Create a new `HeadersWrapper` that wraps the given request.
      Parameters:
        `headers` - the headers to wrap

  - ### Method Detail

    - #### contentLength

          public OptionalLong contentLength()

      Description copied from interface: `ClientResponse.Headers`
      Return the length of the body in bytes, as specified by the `Content-Length` header.
      Specified by:
        `contentLength` in interface `ClientResponse.Headers`

    - #### contentType

          public Optional<MediaType> contentType()

      Description copied from interface: `ClientResponse.Headers`
      Return the media type of the body, as specified by the `Content-Type` header.
      Specified by:
        `contentType` in interface `ClientResponse.Headers`

    - #### header

          public List<String> header(String headerName)

      Description copied from interface: `ClientResponse.Headers`
      Return the header value(s), if any, for the header of the given name.

      Return an empty list if no header values are found.

      Specified by:
        `header` in interface `ClientResponse.Headers`
      Parameters:
        `headerName` - the header name

    - #### asHttpHeaders

          public HttpHeaders asHttpHeaders()

      Description copied from interface: `ClientResponse.Headers`
      Return the headers as an `HttpHeaders` instance.
      Specified by:
        `asHttpHeaders` in interface `ClientResponse.Headers`