- All Superinterfaces:
Headers,HeadersClientResponse,HeadersWritable<HeadersServerResponse>,Iterable<Http.HeaderValue>
public interface HeadersServerResponse
extends HeadersClientResponse, HeadersWritable<HeadersServerResponse>
Mutable headers of a server response.
-
Method Summary
Modifier and TypeMethodDescriptiondefault HeadersServerResponseaddAcceptPatches(HttpMediaType... acceptableMediaTypes) Adds one or more acceptedTypes path document formats (headerHttp.Header.ACCEPT_PATCH).default HeadersServerResponseaddAcceptPatches(MediaType... acceptableMediaTypes) Adds one or more acceptedTypes path document formats (headerHttp.Header.ACCEPT_PATCH).AddsSet-Cookieheader specified in RFC6265.default HeadersServerResponseAddsSet-Cookieheader based on RFC2616.default HeadersServerResponseclearCookie(String name) Clears a cookie by adding aSet-Cookieheader with an expiration date in the past.static HeadersServerResponsecreate()Create a new instance of mutable server response headers.static HeadersServerResponseCreate a new instance of mutable server response headers.default HeadersServerResponseSets the value ofHttp.Header.EXPIRESheader.default HeadersServerResponseexpires(ZonedDateTime dateTime) Sets the value ofHttp.Header.EXPIRESheader.default HeadersServerResponselastModified(Instant modified) Sets the value ofHttp.Header.LAST_MODIFIEDheader.default HeadersServerResponselastModified(ZonedDateTime modified) Sets the value ofHttp.Header.LAST_MODIFIEDheader.default HeadersServerResponseSets the value ofHttp.Header.LOCATIONheader.Methods inherited from interface io.helidon.common.http.Headers
acceptedTypes, all, all, contains, contains, contentLength, contentType, first, get, isAccepted, size, toMap, value, valuesMethods inherited from interface io.helidon.common.http.HeadersClientResponse
acceptPatches, expires, lastModified, locationMethods inherited from interface io.helidon.common.http.HeadersWritable
add, add, clear, contentLength, contentType, contentType, remove, remove, set, set, set, setIfAbsentMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
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 (headerHttp.Header.ACCEPT_PATCH).- Parameters:
acceptableMediaTypes- media types to add.- Returns:
- this instance
-
addAcceptPatches
Adds one or more acceptedTypes path document formats (headerHttp.Header.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 ofHttp.Header.LAST_MODIFIEDheader.The last modified date for the requested object
- Parameters:
modified- Last modified date/time.- Returns:
- this instance
-
lastModified
Sets the value ofHttp.Header.LAST_MODIFIEDheader.The last modified date for the requested object
- Parameters:
modified- Last modified date/time.- Returns:
- this instance
-
location
Sets the value ofHttp.Header.LOCATIONheader.Used in redirection, or when a new resource has been created.
- Parameters:
location- Location header value.- Returns:
- updated headers
-
expires
Sets the value ofHttp.Header.EXPIRESheader.The date/time after which the response is considered stale.
- Parameters:
dateTime- Expires date/time.- Returns:
- updated headers
-
expires
Sets the value ofHttp.Header.EXPIRESheader.The date/time after which the response is considered stale.
- Parameters:
dateTime- Expires date/time.- Returns:
- updated headers
-