- All Superinterfaces:
ClientResponseHeaders
,Headers
,Iterable<Header>
,WritableHeaders<ServerResponseHeaders>
public interface ServerResponseHeaders
extends ClientResponseHeaders, WritableHeaders<ServerResponseHeaders>
Mutable headers of a server response.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ServerResponseHeaders
addAcceptPatches
(MediaType... acceptableMediaTypes) Adds one or more acceptedTypes path document formats (headerHeaderNames.ACCEPT_PATCH
).AddsSet-Cookie
header specified in RFC6265.default ServerResponseHeaders
AddsSet-Cookie
header based on RFC2616.default ServerResponseHeaders
clearCookie
(String name) Clears a cookie by adding aSet-Cookie
header with an expiration date in the past.static ServerResponseHeaders
create()
Create a new instance of mutable server response headers.static ServerResponseHeaders
Create a new instance of mutable server response headers.default ServerResponseHeaders
Sets the value ofHeaderNames.EXPIRES
header.default ServerResponseHeaders
expires
(ZonedDateTime dateTime) Sets the value ofHeaderNames.EXPIRES
header.default ServerResponseHeaders
lastModified
(Instant modified) Sets the value ofHeaderNames.LAST_MODIFIED
header.default ServerResponseHeaders
lastModified
(ZonedDateTime modified) Sets the value ofHeaderNames.LAST_MODIFIED
header.default ServerResponseHeaders
Sets the value ofHeaderNames.LOCATION
header.Methods inherited from interface io.helidon.http.ClientResponseHeaders
acceptPatches, expires, lastModified, location
Methods inherited from interface io.helidon.http.Headers
acceptedTypes, all, contains, contains, contentLength, contentType, first, get, isAccepted, size, stream, toMap, value, values
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface io.helidon.http.WritableHeaders
add, add, add, add, clear, contentLength, contentType, from, remove, remove, set, set, set, set, set, setIfAbsent
-
Method Details
-
create
Create a new instance of mutable server response headers.- Returns:
- new server response headers
-
create
Create a new instance of mutable server response headers.- Parameters:
existing
- headers to add to these response headers- Returns:
- new server response headers
-
addAcceptPatches
Adds one or more acceptedTypes path document formats (headerHeaderNames.ACCEPT_PATCH
).- Parameters:
acceptableMediaTypes
- media types to add.- Returns:
- this instance
-
addCookie
AddsSet-Cookie
header specified in RFC6265.- Parameters:
cookie
- a cookie definition- Returns:
- this instance
-
addCookie
- Parameters:
name
- name of the cookievalue
- value of the cookiemaxAge
-Max-Age
cookie parameter- Returns:
- this instance
-
addCookie
AddsSet-Cookie
header based on RFC2616.- Parameters:
name
- name of the cookievalue
- value of the cookie- Returns:
- this instance
-
clearCookie
Clears a cookie by adding aSet-Cookie
header with an expiration date in the past.- Parameters:
name
- name of the cookie.- Returns:
- this instance
-
lastModified
Sets the value ofHeaderNames.LAST_MODIFIED
header.The last modified date for the requested object
- Parameters:
modified
- Last modified date/time.- Returns:
- this instance
-
lastModified
Sets the value ofHeaderNames.LAST_MODIFIED
header.The last modified date for the requested object
- Parameters:
modified
- Last modified date/time.- Returns:
- this instance
-
location
Sets the value ofHeaderNames.LOCATION
header.Used in redirection, or when a new resource has been created.
- Parameters:
location
- Location header value.- Returns:
- updated headers
-
expires
Sets the value ofHeaderNames.EXPIRES
header.The date/time after which the response is considered stale.
- Parameters:
dateTime
- Expires date/time.- Returns:
- updated headers
-
expires
Sets the value ofHeaderNames.EXPIRES
header.The date/time after which the response is considered stale.
- Parameters:
dateTime
- Expires date/time.- Returns:
- updated headers
-