org.springframework.web.reactive.function.server.support

## Class ServerRequestWrapper.HeadersWrapper

- java.lang.Object
- - org.springframework.web.reactive.function.server.support.ServerRequestWrapper.HeadersWrapper

All Implemented Interfaces:
  ServerRequest.Headers

Enclosing class:
  ServerRequestWrapper

    public static class ServerRequestWrapper.HeadersWrapper
    extends Object
    implements ServerRequest.Headers

Implementation of the `Headers` interface that can be subclassed to adapt the headers in a `handler filter function`. All methods default to calling through to the wrapped headers.

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`List<org.springframework.http.MediaType>` `accept()` Get the list of acceptable media types, as specified by the `Accept` header.
`List<Charset>` `acceptCharset()` Get the list of acceptable charsets, as specified by the `Accept-Charset` header.
`List<Locale.LanguageRange>` `acceptLanguage()` Get the list of acceptable languages, as specified by the `Accept-Language` header.
`org.springframework.http.HttpHeaders` `asHttpHeaders()` Get the headers as an instance of `HttpHeaders`.
`OptionalLong` `contentLength()` Get the length of the body in bytes, as specified by the `Content-Length` header.
`Optional<org.springframework.http.MediaType>` `contentType()` Get the media type of the body, as specified by the `Content-Type` header.
`List<String>` `header(String headerName)` Get the header value(s), if any, for the header with the given name.
`InetSocketAddress` `host()` Get the value of the `Host` header, if available.
`List<org.springframework.http.HttpRange>` `range()` Get the value of the `Range` header.

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

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

### Methods inherited from interface org.springframework.web.reactive.function.server.ServerRequest.Headers

`firstHeader`

### Constructor Detail

#### HeadersWrapper

    public HeadersWrapper(ServerRequest.Headers headers)

Create a new `HeadersWrapper` that wraps the given request.

Parameters:
  `headers` - the headers to wrap

### Method Detail

#### accept

    public List<org.springframework.http.MediaType> accept()

Description copied from interface: `ServerRequest.Headers`
Get the list of acceptable media types, as specified by the `Accept` header.

Returns an empty list if the acceptable media types are unspecified.

Specified by:
  `accept` in interface `ServerRequest.Headers`

#### acceptCharset

    public List<Charset> acceptCharset()

Description copied from interface: `ServerRequest.Headers`
Get the list of acceptable charsets, as specified by the `Accept-Charset` header.

Specified by:
  `acceptCharset` in interface `ServerRequest.Headers`

#### acceptLanguage

    public List<Locale.LanguageRange> acceptLanguage()

Description copied from interface: `ServerRequest.Headers`
Get the list of acceptable languages, as specified by the `Accept-Language` header.

Specified by:
  `acceptLanguage` in interface `ServerRequest.Headers`

#### contentLength

    public OptionalLong contentLength()

Description copied from interface: `ServerRequest.Headers`
Get the length of the body in bytes, as specified by the `Content-Length` header.

Specified by:
  `contentLength` in interface `ServerRequest.Headers`

#### contentType

    public Optional<org.springframework.http.MediaType> contentType()

Description copied from interface: `ServerRequest.Headers`
Get the media type of the body, as specified by the `Content-Type` header.

Specified by:
  `contentType` in interface `ServerRequest.Headers`

#### host

    public InetSocketAddress host()

Description copied from interface: `ServerRequest.Headers`
Get the value of the `Host` header, if available.

If the header value does not contain a port, the port in the returned address will be `0`.

Specified by:
  `host` in interface `ServerRequest.Headers`

#### range

    public List<org.springframework.http.HttpRange> range()

Description copied from interface: `ServerRequest.Headers`
Get the value of the `Range` header.

Returns an empty list when the range is unknown.

Specified by:
  `range` in interface `ServerRequest.Headers`

#### header

    public List<String> header(String headerName)

Description copied from interface: `ServerRequest.Headers`
Get the header value(s), if any, for the header with the given name.

Returns an empty list if no header values are found.

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

#### asHttpHeaders

    public org.springframework.http.HttpHeaders asHttpHeaders()

Description copied from interface: `ServerRequest.Headers`
Get the headers as an instance of `HttpHeaders`.

Specified by:
  `asHttpHeaders` in interface `ServerRequest.Headers`