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
ConstructorDescriptionHeadersWrapper
(ServerRequest.Headers headers) Create a newHeadersWrapper
that wraps the given request. -
Method Summary
Modifier and TypeMethodDescriptionaccept()
Get the list of acceptable media types, as specified by theAccept
header.Get the list of acceptable charsets, as specified by theAccept-Charset
header.Get the list of acceptable languages, as specified by theAccept-Language
header.Get the headers as an instance ofHttpHeaders
.Get the length of the body in bytes, as specified by theContent-Length
header.Get the media type of the body, as specified by theContent-Type
header.Get the header value(s), if any, for the header with the given name.host()
Get the value of theHost
header, if available.range()
Get the value of theRange
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 Details
-
HeadersWrapper
Create a newHeadersWrapper
that wraps the given request.- Parameters:
headers
- the headers to wrap
-
-
Method Details
-
accept
Description copied from interface:ServerRequest.Headers
Get the list of acceptable media types, as specified by theAccept
header.Returns an empty list if the acceptable media types are unspecified.
- Specified by:
accept
in interfaceServerRequest.Headers
-
acceptCharset
Description copied from interface:ServerRequest.Headers
Get the list of acceptable charsets, as specified by theAccept-Charset
header.- Specified by:
acceptCharset
in interfaceServerRequest.Headers
-
acceptLanguage
Description copied from interface:ServerRequest.Headers
Get the list of acceptable languages, as specified by theAccept-Language
header.- Specified by:
acceptLanguage
in interfaceServerRequest.Headers
-
contentLength
Description copied from interface:ServerRequest.Headers
Get the length of the body in bytes, as specified by theContent-Length
header.- Specified by:
contentLength
in interfaceServerRequest.Headers
-
contentType
Description copied from interface:ServerRequest.Headers
Get the media type of the body, as specified by theContent-Type
header.- Specified by:
contentType
in interfaceServerRequest.Headers
-
host
Description copied from interface:ServerRequest.Headers
Get the value of theHost
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 interfaceServerRequest.Headers
-
range
Description copied from interface:ServerRequest.Headers
Get the value of theRange
header.Returns an empty list when the range is unknown.
- Specified by:
range
in interfaceServerRequest.Headers
-
header
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 interfaceServerRequest.Headers
- Parameters:
headerName
- the header name
-
asHttpHeaders
Description copied from interface:ServerRequest.Headers
Get the headers as an instance ofHttpHeaders
.- Specified by:
asHttpHeaders
in interfaceServerRequest.Headers
-