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