public static interface ServerRequest.Headers
ServerRequest.headers()
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
accept()
Return the list of acceptable
MediaType media types ,
as specified by the Accept header. |
java.util.List<java.nio.charset.Charset> |
acceptCharset()
Return the list of acceptable
Charset charsets ,
as specified by the Accept-Charset header. |
java.util.List<java.util.Locale.LanguageRange> |
acceptLanguage()
Return the list of acceptable
Locale.LanguageRange languages ,
as specified by the Accept-Language header. |
HttpHeaders |
asHttpHeaders()
Return the headers as a
HttpHeaders instance. |
java.util.OptionalLong |
contentLength()
Return the length of the body in bytes, as specified by the
Content-Length header. |
java.util.Optional<MediaType> |
contentType()
Return the
MediaType media type of the body, as specified
by the Content-Type header. |
java.util.List<java.lang.String> |
header(java.lang.String headerName)
Return the header value(s), if any, for the header of the given name.
|
java.net.InetSocketAddress |
host()
Return the value of the required
Host header. |
java.util.List<HttpRange> |
range()
Return the value of the
Range header. |
java.util.List<MediaType> accept()
MediaType media types
,
as specified by the Accept
header.
Returns an empty list when the acceptable media types are unspecified.
java.util.List<java.nio.charset.Charset> acceptCharset()
Charset charsets
,
as specified by the Accept-Charset
header.java.util.List<java.util.Locale.LanguageRange> acceptLanguage()
Locale.LanguageRange languages
,
as specified by the Accept-Language
header.java.util.OptionalLong contentLength()
Content-Length
header.java.util.Optional<MediaType> contentType()
MediaType media type
of the body, as specified
by the Content-Type
header.@Nullable java.net.InetSocketAddress host()
Host
header.
If the header value does not contain a port, the returned
port will be 0
.
java.util.List<HttpRange> range()
Range
header.
Returns an empty list when the range is unknown.
java.util.List<java.lang.String> header(java.lang.String headerName)
Return an empty list if no header values are found.
headerName
- the header nameHttpHeaders asHttpHeaders()
HttpHeaders
instance.