Package io.micronaut.http
Interface HttpHeaders
- All Superinterfaces:
ConversionServiceProvider,ConvertibleMultiValues<String>,ConvertibleValues<List<String>>,Headers,Iterable<Map.Entry<String,,List<String>>> ValueResolver<CharSequence>
- All Known Subinterfaces:
MutableHttpHeaders
- All Known Implementing Classes:
CaseInsensitiveMutableHttpHeaders,HttpHeadersAdapter,NettyHttpHeaders,SimpleHttpHeaders
Constants for common HTTP headers. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String"Accept".static final String"Accept-CH".static final String"Accept-CH".static final String"Accept-Charset".static final String"Accept-Encoding".static final String"Accept-Language".static final String"Accept-Patch".static final String"Accept-Ranges".static final String"Access-Control-Allow-Credentials".static final String"Access-Control-Allow-Headers".static final String"Access-Control-Allow-Methods".static final String"Access-Control-Allow-Origin".static final String"Access-Control-Allow-Private-Network".static final String"Access-Control-Expose-Headers".static final String"Access-Control-Max-Age".static final String"Access-Control-Request-Headers".static final String"Access-Control-Request-Method".static final String"Access-Control-Request-Private-Network".static final String"Age".static final String"Allow".static final String"Authorization".static final String"Authorization".static final String"Cache-Control".static final String"Connection".static final String"Content-Base".static final String"Content-Disposition".static final String"Content-DPR".static final String"Content-Encoding".static final String"Content-Language".static final String"Content-Length".static final String"Content-Location".static final String"Content-MD5".static final String"Content-Range".static final String"Content-Transfer-Encoding".static final String"Content-Type".static final String"Cookie".static final String"Cross-Origin-Resource-Policy".static final String"Date".static final String"Device-Memory".static final String"Downlink".static final String"DPR".static final String"ECT".static final String"ETag".static final String"Expect".static final String"Expires".static final String"Feature-Policy".static final String"Forwarded".static final String"From".static final String"Host".static final String"If-Match".static final String"If-Modified-Since".static final String"If-None-Match".static final String"If-Range".static final String"If-Unmodified-Since".static final String"Last-Modified".static final String"Link".static final String"Location".static final String"Max-Forwards".static final String"Origin".static final String"Pragma".static final String"Proxy-Authenticate".static final String"Proxy-Authorization".static final String"Range".static final String"Referer".static final String"Referrer-Policy".static final String"Retry-After".static final String"RTT".static final String"Save-Data".static final String"Sec-WebSocket-Accept".static final String"Sec-WebSocket-Key".static final String"Sec-WebSocket-Key1".static final String"Sec-WebSocket-Key2".static final String"Sec-WebSocket-Location".static final String"Sec-WebSocket-Origin".static final String"Sec-WebSocket-Protocol".static final String"Sec-WebSocket-Version".static final String"Server".static final String"Set-Cookie".static final String"Set-Cookie2".static final String"Source-Map".Unmodifiable List of every header constant defined inHttpHeaders.static final String"TE".static final String"Trailer".static final String"Transfer-Encoding".static final String"Upgrade".static final String"User-Agent".static final String"Vary".static final String"Via".static final String"Viewport-Width".static final String"Warning".static final String"WebSocket-Location".static final String"WebSocket-Origin".static final String"WebSocket-Protocol".static final String"Width".static final String"WWW-Authenticate".static final String"X-Auth-Token".Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionaccept()A list of acceptedMediaTypeinstances.default CharsetTheAccept-Charsetheader, ornullif unset.default LocaleTheAccept-Languageheader, ornullif unset.default booleancontains(CharSequence name) Whether the given key is contained within these values.default OptionalLongThe request or response content type.The request or response content type.TheAccept-Charsetheader, or empty if unset.TheAccept-Languageheader, or empty if unset.default Optional<ZonedDateTime>findDate(CharSequence name) Obtain the date header.findFirst(CharSequence name) Get the first value of the given header.findInt(CharSequence name) Find an integer header.default ZonedDateTimegetDate(CharSequence name) Obtain the date header.default IntegergetInt(CharSequence name) Obtain an integer header.default booleanMethods inherited from interface io.micronaut.core.convert.value.ConvertibleMultiValues
forEach, forEachValue, get, getAll, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iteratorMethods inherited from interface io.micronaut.core.convert.value.ConvertibleValues
asMap, asMap, asProperties, contains, getConversionService, getValue, getValueType, names, subMap, subMap, subMap, valuesMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get, get
-
Field Details
-
ACCEPT
"Accept".- See Also:
-
ACCEPT_CH
"Accept-CH".- See Also:
-
ACCEPT_CH_LIFETIME
"Accept-CH".- See Also:
-
ACCEPT_CHARSET
"Accept-Charset".- See Also:
-
ACCEPT_ENCODING
"Accept-Encoding".- See Also:
-
ACCEPT_LANGUAGE
"Accept-Language".- See Also:
-
ACCEPT_RANGES
"Accept-Ranges".- See Also:
-
ACCEPT_PATCH
"Accept-Patch".- See Also:
-
ACCESS_CONTROL_ALLOW_CREDENTIALS
"Access-Control-Allow-Credentials".- See Also:
-
ACCESS_CONTROL_ALLOW_HEADERS
"Access-Control-Allow-Headers".- See Also:
-
ACCESS_CONTROL_ALLOW_METHODS
"Access-Control-Allow-Methods".- See Also:
-
ACCESS_CONTROL_ALLOW_ORIGIN
"Access-Control-Allow-Origin".- See Also:
-
ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK
"Access-Control-Allow-Private-Network".- Since:
- 4.3.0
- See Also:
-
ACCESS_CONTROL_EXPOSE_HEADERS
"Access-Control-Expose-Headers".- See Also:
-
ACCESS_CONTROL_MAX_AGE
"Access-Control-Max-Age".- See Also:
-
ACCESS_CONTROL_REQUEST_HEADERS
"Access-Control-Request-Headers".- See Also:
-
ACCESS_CONTROL_REQUEST_METHOD
"Access-Control-Request-Method".- See Also:
-
ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK
"Access-Control-Request-Private-Network".- Since:
- 4.3.0
- See Also:
-
AGE
"Age".- See Also:
-
ALLOW
"Allow".- See Also:
-
AUTHORIZATION
"Authorization".- See Also:
-
AUTHORIZATION_INFO
"Authorization".- See Also:
-
CACHE_CONTROL
"Cache-Control".- See Also:
-
CONNECTION
"Connection".- See Also:
-
CONTENT_BASE
"Content-Base".- See Also:
-
CONTENT_DISPOSITION
"Content-Disposition".- See Also:
-
CONTENT_DPR
"Content-DPR".- See Also:
-
CONTENT_ENCODING
"Content-Encoding".- See Also:
-
CONTENT_LANGUAGE
"Content-Language".- See Also:
-
CONTENT_LENGTH
"Content-Length".- See Also:
-
CONTENT_LOCATION
"Content-Location".- See Also:
-
CONTENT_TRANSFER_ENCODING
"Content-Transfer-Encoding".- See Also:
-
CONTENT_MD5
"Content-MD5".- See Also:
-
CONTENT_RANGE
"Content-Range".- See Also:
-
CONTENT_TYPE
"Content-Type".- See Also:
-
COOKIE
"Cookie".- See Also:
-
CROSS_ORIGIN_RESOURCE_POLICY
"Cross-Origin-Resource-Policy".- See Also:
-
DATE
"Date".- See Also:
-
DEVICE_MEMORY
"Device-Memory".- See Also:
-
DOWNLINK
"Downlink".- See Also:
-
DPR
"DPR".- See Also:
-
ECT
"ECT".- See Also:
-
ETAG
"ETag".- See Also:
-
EXPECT
"Expect".- See Also:
-
EXPIRES
"Expires".- See Also:
-
FEATURE_POLICY
"Feature-Policy".- See Also:
-
FORWARDED
"Forwarded".- See Also:
-
FROM
"From".- See Also:
-
HOST
"Host".- See Also:
-
IF_MATCH
"If-Match".- See Also:
-
IF_MODIFIED_SINCE
"If-Modified-Since".- See Also:
-
IF_NONE_MATCH
"If-None-Match".- See Also:
-
IF_RANGE
"If-Range".- See Also:
-
IF_UNMODIFIED_SINCE
"If-Unmodified-Since".- See Also:
-
LAST_MODIFIED
"Last-Modified".- See Also:
-
LINK
"Link".- See Also:
-
LOCATION
"Location".- See Also:
-
MAX_FORWARDS
"Max-Forwards".- See Also:
-
ORIGIN
"Origin".- See Also:
-
PRAGMA
"Pragma".- See Also:
-
PROXY_AUTHENTICATE
"Proxy-Authenticate".- See Also:
-
PROXY_AUTHORIZATION
"Proxy-Authorization".- See Also:
-
RANGE
"Range".- See Also:
-
REFERER
"Referer".- See Also:
-
REFERRER_POLICY
"Referrer-Policy".- See Also:
-
RETRY_AFTER
"Retry-After".- See Also:
-
RTT
"RTT".- See Also:
-
SAVE_DATA
"Save-Data".- See Also:
-
SEC_WEBSOCKET_KEY1
"Sec-WebSocket-Key1".- See Also:
-
SEC_WEBSOCKET_KEY2
"Sec-WebSocket-Key2".- See Also:
-
SEC_WEBSOCKET_LOCATION
"Sec-WebSocket-Location".- See Also:
-
SEC_WEBSOCKET_ORIGIN
"Sec-WebSocket-Origin".- See Also:
-
SEC_WEBSOCKET_PROTOCOL
"Sec-WebSocket-Protocol".- See Also:
-
SEC_WEBSOCKET_VERSION
"Sec-WebSocket-Version".- See Also:
-
SEC_WEBSOCKET_KEY
"Sec-WebSocket-Key".- See Also:
-
SEC_WEBSOCKET_ACCEPT
"Sec-WebSocket-Accept".- See Also:
-
SERVER
"Server".- See Also:
-
SET_COOKIE
"Set-Cookie".- See Also:
-
SET_COOKIE2
"Set-Cookie2".- See Also:
-
SOURCE_MAP
"Source-Map".- See Also:
-
TE
"TE".- See Also:
-
TRAILER
"Trailer".- See Also:
-
TRANSFER_ENCODING
"Transfer-Encoding".- See Also:
-
UPGRADE
"Upgrade".- See Also:
-
USER_AGENT
"User-Agent".- See Also:
-
VARY
"Vary".- See Also:
-
VIA
"Via".- See Also:
-
VIEWPORT_WIDTH
"Viewport-Width".- See Also:
-
WARNING
"Warning".- See Also:
-
WEBSOCKET_LOCATION
"WebSocket-Location".- See Also:
-
WEBSOCKET_ORIGIN
"WebSocket-Origin".- See Also:
-
WEBSOCKET_PROTOCOL
"WebSocket-Protocol".- See Also:
-
WIDTH
"Width".- See Also:
-
WWW_AUTHENTICATE
"WWW-Authenticate".- See Also:
-
X_AUTH_TOKEN
"X-Auth-Token".- See Also:
-
STANDARD_HEADERS
Unmodifiable List of every header constant defined inHttpHeaders.
-
-
Method Details
-
contains
Whether the given key is contained within these values.- Parameters:
name- The key name- Returns:
- True if it is
- Since:
- 4.8.0
-
findDate
Obtain the date header.- Parameters:
name- The header name- Returns:
- The date header as a
ZonedDateTimeotherwise if it is not present or cannot be parsedOptional.empty()
-
getDate
Obtain the date header.- Parameters:
name- The header name- Returns:
- The date header as a
ZonedDateTimeotherwise if it is not present or cannot be parsed null
-
getInt
Obtain an integer header.- Parameters:
name- The header name- Returns:
- The date header as a
ZonedDateTimeotherwise if it is not present or cannot be parsed null
-
findInt
Find an integer header. -
findFirst
Get the first value of the given header.- Parameters:
name- The header name- Returns:
- The first value or null if it is present
-
contentType
The request or response content type.- Returns:
- The content type
-
contentLength
The request or response content type.- Returns:
- The content type
-
accept
A list of acceptedMediaTypeinstances.- Returns:
- A list of zero or many
MediaTypeinstances
-
acceptCharset
TheAccept-Charsetheader, ornullif unset.- Returns:
- The
Accept-Charsetheader - Since:
- 4.0.0
-
findAcceptCharset
TheAccept-Charsetheader, or empty if unset.- Returns:
- The
Accept-Charsetheader - Since:
- 4.3.0
-
acceptLanguage
TheAccept-Languageheader, ornullif unset.- Returns:
- The
Accept-Languageheader - Since:
- 4.0.0
-
findAcceptLanguage
TheAccept-Languageheader, or empty if unset.- Returns:
- The
Accept-Languageheader - Since:
- 4.3.0
-
isKeepAlive
default boolean isKeepAlive()- Returns:
- Whether the
CONNECTIONheader is set to Keep-Alive
-
getOrigin
- Returns:
- The
ORIGINheader
-
getAuthorization
- Returns:
- The
AUTHORIZATIONheader
-
getContentType
- Returns:
- The
CONTENT_TYPEheader
-