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