Package io.micronaut.http
Interface MutableHttpHeaders
- All Superinterfaces:
- ConversionServiceAware,- ConversionServiceProvider,- ConvertibleMultiValues<String>,- ConvertibleValues<List<String>>,- Headers,- HttpHeaders,- Iterable<Map.Entry<String,,- List<String>>> - MutableHeaders,- ValueResolver<CharSequence>
- All Known Implementing Classes:
- CaseInsensitiveMutableHttpHeaders,- NettyHttpHeaders,- SimpleHttpHeaders
Extends 
HttpHeaders add methods for mutation of headers.- Since:
- 1.0
- Author:
- Graeme Rocher
- 
Field SummaryFieldsFields inherited from interface io.micronaut.core.convert.value.ConvertibleValuesEMPTYFields inherited from interface io.micronaut.http.HttpHeadersACCEPT, ACCEPT_CH, ACCEPT_CH_LIFETIME, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_PATCH, ACCEPT_RANGES, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK, AGE, ALLOW, AUTHORIZATION, AUTHORIZATION_INFO, CACHE_CONTROL, CONNECTION, CONTENT_BASE, CONTENT_DISPOSITION, CONTENT_DPR, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, CROSS_ORIGIN_RESOURCE_POLICY, DATE, DEVICE_MEMORY, DOWNLINK, DPR, ECT, ETAG, EXPECT, EXPIRES, FEATURE_POLICY, FORWARDED, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, REFERRER_POLICY, RETRY_AFTER, RTT, SAVE_DATA, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_KEY1, SEC_WEBSOCKET_KEY2, SEC_WEBSOCKET_LOCATION, SEC_WEBSOCKET_ORIGIN, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION, SERVER, SET_COOKIE, SET_COOKIE2, SOURCE_MAP, STANDARD_HEADERS, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, VIEWPORT_WIDTH, WARNING, WEBSOCKET_LOCATION, WEBSOCKET_ORIGIN, WEBSOCKET_PROTOCOL, WIDTH, WWW_AUTHENTICATE, X_AUTH_TOKEN
- 
Method SummaryModifier and TypeMethodDescriptionadd(CharSequence header, CharSequence value) Add a header for the given name and value.default MutableHttpHeadersadd(CharSequence header, Integer value) Add a header for the given name and value.default MutableHttpHeadersadd(CharSequence header, ZonedDateTime value) Add a header for the given name and value.default MutableHttpHeadersallow(HttpMethod... methods) Set the allowed HTTP methods.default MutableHttpHeadersallow(Collection<HttpMethod> methods) Set the allowed HTTP methods.default MutableHttpHeadersallowGeneric(Collection<? extends CharSequence> methods) Set the allowed HTTP methods.default MutableHttpHeadersUsed to configure BASIC authentication.default MutableHttpHeadersUsed to configure BASIC authentication.default MutableHttpHeaderscontentType(MediaType mediaType) Sets theHttpHeaders.CONTENT_TYPEheader to the given media type.default MutableHttpHeaderscontentTypeIfMissing(MediaType mediaType) Sets theHttpHeaders.CONTENT_TYPEheader to the given media type, if the header is missing.default MutableHttpHeadersdate(long timeInMillis) Adds the DATE header for the givenLong.default MutableHttpHeadersdate(LocalDateTime date) Adds the date header for the givenLocalDateTime.default MutableHttpHeadersexpires(long timeInMillis) Adds the EXPIRES header for the givenLong.default MutableHttpHeadersexpires(LocalDateTime date) Adds the EXPIRES header for the givenLocalDateTime.default MutableHttpHeadersifModifiedSince(long timeInMillis) Adds the IF_MODIFIED_SINCE header for the givenLong.default MutableHttpHeadersifModifiedSince(LocalDateTime date) Adds the IF_MODIFIED_SINCE header for the givenZonedDateTime.default MutableHttpHeaderslastModified(long timeInMillis) Adds the LAST_MODIFIED header for the givenLong.default MutableHttpHeaderslastModified(LocalDateTime date) Adds the LAST_MODIFIED header for the givenLocalDateTime.default MutableHttpHeadersSets the location header to the given URI.remove(CharSequence header) Removes a header.default MutableHeadersset(CharSequence header, CharSequence value) Sets an HTTP header overriding any existing value.Methods inherited from interface io.micronaut.core.convert.ConversionServiceAwaresetConversionServiceMethods inherited from interface io.micronaut.core.convert.value.ConvertibleMultiValuesforEach, forEachValue, get, getAll, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iteratorMethods inherited from interface io.micronaut.core.convert.value.ConvertibleValuesasMap, asMap, asProperties, contains, getConversionService, getValue, getValueType, names, subMap, subMap, subMap, valuesMethods inherited from interface io.micronaut.http.HttpHeadersaccept, acceptCharset, acceptLanguage, contains, contentLength, contentType, findAcceptCharset, findAcceptLanguage, findDate, findFirst, findInt, getAuthorization, getContentType, getDate, getInt, getOrigin, isKeepAliveMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface io.micronaut.core.type.MutableHeaderssetIfMissingMethods inherited from interface io.micronaut.core.value.ValueResolverget, get, get, get
- 
Field Details- 
GMTThe default GMT zone for date values.
 
- 
- 
Method Details- 
addAdd a header for the given name and value.- Specified by:
- addin interface- MutableHeaders
- Parameters:
- header- The header name
- value- The value
- Returns:
- This headers object
 
- 
removeDescription copied from interface:MutableHeadersRemoves a header.- Specified by:
- removein interface- MutableHeaders
- Parameters:
- header- The header to remove
- Returns:
- These headers
 
- 
setDescription copied from interface:MutableHeadersSets an HTTP header overriding any existing value.- Specified by:
- setin interface- MutableHeaders
- Parameters:
- header- The header
- value- The value
- Returns:
- This headers
 
- 
allowSet the allowed HTTP methods.- Parameters:
- methods- The methods to specify in the Allowed HTTP header
- Returns:
- This HTTP headers
 
- 
dateAdds the date header for the givenLocalDateTime.- Parameters:
- date- The local date time (assumed to represent system's default time-zone- ZoneId.systemDefault(), will be converted to GMT) as per- DateTimeFormatter.RFC_1123_DATE_TIME
- Returns:
- The MutableHttpHeaders
- See Also:
 
- 
expiresAdds the EXPIRES header for the givenLocalDateTime.- Parameters:
- date- The local date time (assumed to represent system's default time-zone- ZoneId.systemDefault(), will be converted to GMT) as per- DateTimeFormatter.RFC_1123_DATE_TIME
- Returns:
- The MutableHttpHeaders
- See Also:
 
- 
lastModifiedAdds the LAST_MODIFIED header for the givenLocalDateTime.- Parameters:
- date- The local date time (assumed to represent system's default time-zone- ZoneId.systemDefault(), will be converted to GMT) as per- DateTimeFormatter.RFC_1123_DATE_TIME
- Returns:
- The MutableHttpHeaders
- See Also:
 
- 
ifModifiedSinceAdds the IF_MODIFIED_SINCE header for the givenZonedDateTime.- Parameters:
- date- The local date time (assumed to represent system's default time-zone- ZoneId.systemDefault(), will be converted to GMT) as per- DateTimeFormatter.RFC_1123_DATE_TIME
- Returns:
- The MutableHttpHeaders
- See Also:
 
- 
dateAdds the DATE header for the givenLong.- Parameters:
- timeInMillis- The time in milliseconds since Epoch.
- Returns:
- The MutableHttpHeaders
 
- 
expiresAdds the EXPIRES header for the givenLong.- Parameters:
- timeInMillis- The time in milliseconds since Epoch.
- Returns:
- The MutableHttpHeaders
 
- 
lastModifiedAdds the LAST_MODIFIED header for the givenLong.- Parameters:
- timeInMillis- The time in milliseconds since Epoch.
- Returns:
- The MutableHttpHeaders
 
- 
ifModifiedSinceAdds the IF_MODIFIED_SINCE header for the givenLong.- Parameters:
- timeInMillis- The time in milliseconds since Epoch.
- Returns:
- The MutableHttpHeaders
 
- 
authUsed to configure BASIC authentication.- Parameters:
- username- The username
- password- The password
- Returns:
- This HTTP headers
 
- 
authUsed to configure BASIC authentication.- Parameters:
- userInfo- The user info which is in the form "username:password"
- Returns:
- This HTTP headers
 
- 
allowSet the allowed HTTP methods.- Parameters:
- methods- The methods to specify in the Allowed HTTP header
- Returns:
- This HTTP headers
 
- 
allowGenericSet the allowed HTTP methods.- Parameters:
- methods- The methods to specify in the Allowed HTTP header
- Returns:
- This HTTP headers
 
- 
locationSets the location header to the given URI.- Parameters:
- uri- The URI
- Returns:
- This HTTP headers
 
- 
contentTypeSets theHttpHeaders.CONTENT_TYPEheader to the given media type.- Parameters:
- mediaType- The media type
- Returns:
- This HTTP headers
 
- 
contentTypeIfMissingSets theHttpHeaders.CONTENT_TYPEheader to the given media type, if the header is missing.- Parameters:
- mediaType- The media type
- Returns:
- This HTTP headers
 
- 
addAdd a header for the given name and value.- Parameters:
- header- The header name
- value- The value
- Returns:
- This headers object
 
- 
addAdd a header for the given name and value.- Parameters:
- header- The header name
- value- The value
- Returns:
- This headers object
 
 
-