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
ConstructorsConstructorDescriptionHeadersWrapper(ServerRequest.Headers headers) Create a newHeadersWrapperthat wraps the given request. -
Method Summary
Modifier and TypeMethodDescriptionaccept()Get the list of acceptable media types, as specified by theAcceptheader.Get the list of acceptable charsets, as specified by theAccept-Charsetheader.Get the list of acceptable languages, as specified by theAccept-Languageheader.Get the headers as an instance ofHttpHeaders.Get the length of the body in bytes, as specified by theContent-Lengthheader.Get the media type of the body, as specified by theContent-Typeheader.Get the header value(s), if any, for the header with the given name.host()Get the value of theHostheader, if available.range()Get the value of theRangeheader.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.reactive.function.server.ServerRequest.Headers
firstHeader
-
Constructor Details
-
HeadersWrapper
Create a newHeadersWrapperthat wraps the given request.- Parameters:
headers- the headers to wrap
-
-
Method Details
-
accept
Description copied from interface:ServerRequest.HeadersGet the list of acceptable media types, as specified by theAcceptheader.Returns an empty list if the acceptable media types are unspecified.
- Specified by:
acceptin interfaceServerRequest.Headers
-
acceptCharset
Description copied from interface:ServerRequest.HeadersGet the list of acceptable charsets, as specified by theAccept-Charsetheader.- Specified by:
acceptCharsetin interfaceServerRequest.Headers
-
acceptLanguage
Description copied from interface:ServerRequest.HeadersGet the list of acceptable languages, as specified by theAccept-Languageheader.- Specified by:
acceptLanguagein interfaceServerRequest.Headers
-
contentLength
Description copied from interface:ServerRequest.HeadersGet the length of the body in bytes, as specified by theContent-Lengthheader.- Specified by:
contentLengthin interfaceServerRequest.Headers
-
contentType
Description copied from interface:ServerRequest.HeadersGet the media type of the body, as specified by theContent-Typeheader.- Specified by:
contentTypein interfaceServerRequest.Headers
-
host
Description copied from interface:ServerRequest.HeadersGet the value of theHostheader, if available.If the header value does not contain a port, the port in the returned address will be
0.- Specified by:
hostin interfaceServerRequest.Headers
-
range
Description copied from interface:ServerRequest.HeadersGet the value of theRangeheader.Returns an empty list when the range is unknown.
- Specified by:
rangein interfaceServerRequest.Headers
-
header
Description copied from interface:ServerRequest.HeadersGet 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:
headerin interfaceServerRequest.Headers- Parameters:
headerName- the header name
-
asHttpHeaders
Description copied from interface:ServerRequest.HeadersGet the headers as an instance ofHttpHeaders.- Specified by:
asHttpHeadersin interfaceServerRequest.Headers
-