- 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 ServerResponseHeadersaddAcceptPatches(MediaType... acceptableMediaTypes) Adds one or more acceptedTypes path document formats (headerHeaderNames.ACCEPT_PATCH).AddsSet-Cookieheader specified in RFC6265.default ServerResponseHeadersAddsSet-Cookieheader based on RFC2616.default ServerResponseHeadersclearCookie(String name) Clears a cookie by adding aSet-Cookieheader with an expiration date in the past.static ServerResponseHeaderscreate()Create a new instance of mutable server response headers.static ServerResponseHeadersCreate a new instance of mutable server response headers.default ServerResponseHeadersSets the value ofHeaderNames.EXPIRESheader.default ServerResponseHeadersexpires(ZonedDateTime dateTime) Sets the value ofHeaderNames.EXPIRESheader.default ServerResponseHeaderslastModified(Instant modified) Sets the value ofHeaderNames.LAST_MODIFIEDheader.default ServerResponseHeaderslastModified(ZonedDateTime modified) Sets the value ofHeaderNames.LAST_MODIFIEDheader.default ServerResponseHeadersSets the value ofHeaderNames.LOCATIONheader.Methods inherited from interface io.helidon.http.ClientResponseHeaders
acceptPatches, expires, lastModified, locationMethods inherited from interface io.helidon.http.Headers
acceptedTypes, all, contains, contains, contentLength, contentType, first, get, isAccepted, size, stream, toMap, value, valuesMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods 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-Cookieheader specified in RFC6265.- Parameters:
cookie- a cookie definition- Returns:
- this instance
-
addCookie
- Parameters:
name- name of the cookievalue- value of the cookiemaxAge-Max-Agecookie parameter- Returns:
- this instance
-
addCookie
AddsSet-Cookieheader based on RFC2616.- Parameters:
name- name of the cookievalue- value of the cookie- Returns:
- this instance
-
clearCookie
Clears a cookie by adding aSet-Cookieheader with an expiration date in the past.- Parameters:
name- name of the cookie.- Returns:
- this instance
-
lastModified
Sets the value ofHeaderNames.LAST_MODIFIEDheader.The last modified date for the requested object
- Parameters:
modified- Last modified date/time.- Returns:
- this instance
-
lastModified
Sets the value ofHeaderNames.LAST_MODIFIEDheader.The last modified date for the requested object
- Parameters:
modified- Last modified date/time.- Returns:
- this instance
-
location
Sets the value ofHeaderNames.LOCATIONheader.Used in redirection, or when a new resource has been created.
- Parameters:
location- Location header value.- Returns:
- updated headers
-
expires
Sets the value ofHeaderNames.EXPIRESheader.The date/time after which the response is considered stale.
- Parameters:
dateTime- Expires date/time.- Returns:
- updated headers
-
expires
Sets the value ofHeaderNames.EXPIRESheader.The date/time after which the response is considered stale.
- Parameters:
dateTime- Expires date/time.- Returns:
- updated headers
-