- All Superinterfaces:
Headers,Parameters
Headers that can be modified (until request is sent) for
outbound request.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of acceptedTypes ("Accept" header) content types in quality factor order.Add acceptedMediaType.addAll(Parameters parameters) Add a cookie to the request.voidclear()Clears all currently set headers.Returns content length if known.contentLength(long length) Set a content length.Returns content type of the request.contentType(MediaType contentType) Set a content type.ifMatch()Returns value of header "If-Match".SetsHttp.Header.IF_MATCHheader to specific etags.Returns value of header "If-Modified-Since".ifModifiedSince(ZonedDateTime time) SetsHttp.Header.IF_MODIFIED_SINCEheader to specific time.Returns value of header "If-None-Match".ifNoneMatch(String... etags) SetsHttp.Header.IF_NONE_MATCHheader to specific etags.SetsHttp.Header.IF_RANGEheader to specific etag.ifRange(ZonedDateTime time) SetsHttp.Header.IF_RANGEheader to specific time.Returns value of header "If-Range" as aZonedDateTime.Returns value of header "If-Range" as aString.Returns value of header "If-Unmodified-Since".SetsHttp.Header.IF_UNMODIFIED_SINCEheader to specific time.putAll(Parameters parameters) unsetHeader(String name) Remove a header if set.Methods inherited from interface io.helidon.common.http.Parameters
computeIfAbsent, computeSingleIfAbsent, first, put, put, putIfAbsent, putIfAbsent, remove, toMap
-
Method Details
-
unsetHeader
Remove a header if set.- Parameters:
name- header name- Returns:
- updated headers instance
-
addCookie
Add a cookie to the request.- Parameters:
name- cookie namevalue- cookie value- Returns:
- updated headers instance
-
contentType
Set a content type. This method is optional if you use a writer for a specific type. If the content type is explicitly defined, writer will NOT override it.- Parameters:
contentType- content type of the request- Returns:
- updated headers instance
-
contentLength
Set a content length. This method is optional. Use only when you know the exact length of entity in bytes.- Parameters:
length- content length of entity- Returns:
- updated headers instance
-
addAccept
Add acceptedMediaType. Supports quality factor and wildcards. Ordered by invocation order.- Parameters:
mediaType- media type to accept, with optional quality factor- Returns:
- updated headers instance
-
ifModifiedSince
SetsHttp.Header.IF_MODIFIED_SINCEheader to specific time.- Parameters:
time- zoned date time- Returns:
- updated headers instance
-
ifUnmodifiedSince
SetsHttp.Header.IF_UNMODIFIED_SINCEheader to specific time.- Parameters:
time- zoned date time- Returns:
- updated headers instance
-
ifNoneMatch
SetsHttp.Header.IF_NONE_MATCHheader to specific etags.- Parameters:
etags- etags- Returns:
- updated headers instance
-
ifMatch
SetsHttp.Header.IF_MATCHheader to specific etags.- Parameters:
etags- etags- Returns:
- updated headers instance
-
ifRange
SetsHttp.Header.IF_RANGEheader to specific time.- Parameters:
time- zoned date time- Returns:
- updated headers instance
-
ifRange
SetsHttp.Header.IF_RANGEheader to specific etag.- Parameters:
etag- etag- Returns:
- updated headers instance
-
acceptedTypes
Returns a list of acceptedTypes ("Accept" header) content types in quality factor order. Nevernull.- Returns:
- A list of acceptedTypes media types.
-
contentType
MediaType contentType()Returns content type of the request. If there is no explicit content set, thenMediaType.WILDCARDis returned.- Returns:
- content type of the request
-
contentLength
Returns content length if known.- Returns:
- content length
-
ifModifiedSince
Optional<ZonedDateTime> ifModifiedSince()Returns value of header "If-Modified-Since".- Returns:
- IF_MODIFIED_SINCE header value.
-
ifUnmodifiedSince
Optional<ZonedDateTime> ifUnmodifiedSince()Returns value of header "If-Unmodified-Since".- Returns:
- IF_UNMODIFIED_SINCE header value.
-
ifNoneMatch
Returns value of header "If-None-Match". EmptyListis returned if this header is not set.- Returns:
- A list of etags.
-
ifMatch
Returns value of header "If-Match". EmptyListis returned if this header is not set.- Returns:
- A list of etags.
-
ifRangeDate
Optional<ZonedDateTime> ifRangeDate()Returns value of header "If-Range" as aZonedDateTime.- Returns:
- formatted header IF_RANGE as ZonedDateTime
-
ifRangeString
Returns value of header "If-Range" as aString.- Returns:
- formatted header IF_RANGE as String
-
clear
void clear()Clears all currently set headers. -
putAll
- Specified by:
putAllin interfaceParameters
-
add
- Specified by:
addin interfaceParameters
-
add
- Specified by:
addin interfaceParameters
-
addAll
- Specified by:
addAllin interfaceParameters
-