类 ServerRequestWrapper.HeadersWrapper
- java.lang.Object
- org.springframework.web.reactive.function.server.support.ServerRequestWrapper.HeadersWrapper
- 所有已实现的接口:
ServerRequest.Headers
public static class ServerRequestWrapper.HeadersWrapper extends Object implements ServerRequest.Headers
Implementation of theHeaders
interface that can be subclassed to adapt the headers in ahandler filter function
. All methods default to calling through to the wrapped headers.
构造器概要
构造器 构造器 说明 HeadersWrapper(ServerRequest.Headers headers)
Create a newHeadersWrapper
that wraps the given request.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<MediaType>
accept()
Get the list of acceptable media types, as specified by theAccept
header.List<Charset>
acceptCharset()
Get the list of acceptable charsets, as specified by theAccept-Charset
header.List<Locale.LanguageRange>
acceptLanguage()
Get the list of acceptable languages, as specified by theAccept-Language
header.HttpHeaders
asHttpHeaders()
Get the headers as an instance ofHttpHeaders
.OptionalLong
contentLength()
Get the length of the body in bytes, as specified by theContent-Length
header.Optional<MediaType>
contentType()
Get the media type of the body, as specified by theContent-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 theHost
header, if available.List<HttpRange>
range()
Get the value of theRange
header.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.reactive.function.server.ServerRequest.Headers
firstHeader
构造器详细资料
HeadersWrapper
public HeadersWrapper(ServerRequest.Headers headers)
Create a newHeadersWrapper
that wraps the given request.- 参数:
headers
- the headers to wrap
方法详细资料
accept
public List<MediaType> accept()
从接口复制的说明: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.
- 指定者:
accept
在接口中ServerRequest.Headers
acceptCharset
public List<Charset> acceptCharset()
从接口复制的说明:ServerRequest.Headers
Get the list of acceptable charsets, as specified by theAccept-Charset
header.- 指定者:
acceptCharset
在接口中ServerRequest.Headers
acceptLanguage
public List<Locale.LanguageRange> acceptLanguage()
从接口复制的说明:ServerRequest.Headers
Get the list of acceptable languages, as specified by theAccept-Language
header.- 指定者:
acceptLanguage
在接口中ServerRequest.Headers
contentLength
public OptionalLong contentLength()
从接口复制的说明:ServerRequest.Headers
Get the length of the body in bytes, as specified by theContent-Length
header.- 指定者:
contentLength
在接口中ServerRequest.Headers
contentType
public Optional<MediaType> contentType()
从接口复制的说明:ServerRequest.Headers
Get the media type of the body, as specified by theContent-Type
header.- 指定者:
contentType
在接口中ServerRequest.Headers
host
public InetSocketAddress host()
从接口复制的说明: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
.- 指定者:
host
在接口中ServerRequest.Headers
range
public List<HttpRange> range()
从接口复制的说明:ServerRequest.Headers
Get the value of theRange
header.Returns an empty list when the range is unknown.
- 指定者:
range
在接口中ServerRequest.Headers
header
public List<String> header(String headerName)
从接口复制的说明: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.
- 指定者:
header
在接口中ServerRequest.Headers
- 参数:
headerName
- the header name
asHttpHeaders
public HttpHeaders asHttpHeaders()
从接口复制的说明:ServerRequest.Headers
Get the headers as an instance ofHttpHeaders
.- 指定者:
asHttpHeaders
在接口中ServerRequest.Headers