-
- All Superinterfaces:
Headers
,Parameters
public interface WebClientRequestHeaders extends Headers
Headers that can be modified (until request is sent) for outbound request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<MediaType>
acceptedTypes()
Returns a list of acceptedTypes ("Accept" header) content types in quality factor order.WebClientRequestHeaders
add(String key, Iterable<String> values)
Adds specified values tu association with the specified key (optional operation).WebClientRequestHeaders
add(String key, String... values)
Adds specified values tu association with the specified key (optional operation).WebClientRequestHeaders
addAccept(MediaType mediaType)
Add acceptedMediaType
.WebClientRequestHeaders
addAll(Parameters parameters)
Copies all of the mappings from the specifiedparameters
to this instance adding values to existing associations (optional operation).WebClientRequestHeaders
addCookie(String name, String value)
Add a cookie to the request.void
clear()
Clears all currently set headers.Optional<Long>
contentLength()
Returns content length if known.WebClientRequestHeaders
contentLength(long length)
Set a content length.MediaType
contentType()
Returns content type of the request.WebClientRequestHeaders
contentType(MediaType contentType)
Set a content type.List<String>
ifMatch()
Returns value of header "If-Match".WebClientRequestHeaders
ifMatch(String... etags)
SetsHttp.Header.IF_MATCH
header to specific etags.Optional<ZonedDateTime>
ifModifiedSince()
Returns value of header "If-Modified-Since".WebClientRequestHeaders
ifModifiedSince(ZonedDateTime time)
SetsHttp.Header.IF_MODIFIED_SINCE
header to specific time.List<String>
ifNoneMatch()
Returns value of header "If-None-Match".WebClientRequestHeaders
ifNoneMatch(String... etags)
SetsHttp.Header.IF_NONE_MATCH
header to specific etags.WebClientRequestHeaders
ifRange(String etag)
SetsHttp.Header.IF_RANGE
header to specific etag.WebClientRequestHeaders
ifRange(ZonedDateTime time)
SetsHttp.Header.IF_RANGE
header to specific time.Optional<ZonedDateTime>
ifRangeDate()
Returns value of header "If-Range" as aZonedDateTime
.Optional<String>
ifRangeString()
Returns value of header "If-Range" as aString
.Optional<ZonedDateTime>
ifUnmodifiedSince()
Returns value of header "If-Unmodified-Since".WebClientRequestHeaders
ifUnmodifiedSince(ZonedDateTime time)
SetsHttp.Header.IF_UNMODIFIED_SINCE
header to specific time.WebClientRequestHeaders
putAll(Parameters parameters)
Copies all of the mappings from the specifiedparameters
to this instance replacing values of existing associations (optional operation).WebClientRequestHeaders
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 Detail
-
unsetHeader
WebClientRequestHeaders unsetHeader(String name)
Remove a header if set.- Parameters:
name
- header name- Returns:
- updated headers instance
-
addCookie
WebClientRequestHeaders addCookie(String name, String value)
Add a cookie to the request.- Parameters:
name
- cookie namevalue
- cookie value- Returns:
- updated headers instance
-
contentType
WebClientRequestHeaders contentType(MediaType 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
WebClientRequestHeaders contentLength(long length)
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
WebClientRequestHeaders addAccept(MediaType mediaType)
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
WebClientRequestHeaders ifModifiedSince(ZonedDateTime time)
SetsHttp.Header.IF_MODIFIED_SINCE
header to specific time.- Parameters:
time
- zoned date time- Returns:
- updated headers instance
-
ifUnmodifiedSince
WebClientRequestHeaders ifUnmodifiedSince(ZonedDateTime time)
SetsHttp.Header.IF_UNMODIFIED_SINCE
header to specific time.- Parameters:
time
- zoned date time- Returns:
- updated headers instance
-
ifNoneMatch
WebClientRequestHeaders ifNoneMatch(String... etags)
SetsHttp.Header.IF_NONE_MATCH
header to specific etags.- Parameters:
etags
- etags- Returns:
- updated headers instance
-
ifMatch
WebClientRequestHeaders ifMatch(String... etags)
SetsHttp.Header.IF_MATCH
header to specific etags.- Parameters:
etags
- etags- Returns:
- updated headers instance
-
ifRange
WebClientRequestHeaders ifRange(ZonedDateTime time)
SetsHttp.Header.IF_RANGE
header to specific time.- Parameters:
time
- zoned date time- Returns:
- updated headers instance
-
ifRange
WebClientRequestHeaders ifRange(String etag)
SetsHttp.Header.IF_RANGE
header to specific etag.- Parameters:
etag
- etag- Returns:
- updated headers instance
-
acceptedTypes
List<MediaType> 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.WILDCARD
is returned.- Returns:
- content type of the request
-
contentLength
Optional<Long> 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
List<String> ifNoneMatch()
Returns value of header "If-None-Match". EmptyList
is returned if this header is not set.- Returns:
- A list of etags.
-
ifMatch
List<String> ifMatch()
Returns value of header "If-Match". EmptyList
is 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
Optional<String> 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
WebClientRequestHeaders putAll(Parameters parameters)
Description copied from interface:Parameters
Copies all of the mappings from the specifiedparameters
to this instance replacing values of existing associations (optional operation).- Specified by:
putAll
in interfaceParameters
- Parameters:
parameters
- to copy.- Returns:
- this instance of
Parameters
-
add
WebClientRequestHeaders add(String key, String... values)
Description copied from interface:Parameters
Adds specified values tu association with the specified key (optional operation). If parameters doesn't contains mapping, new mapping is created.- Specified by:
add
in interfaceParameters
- Parameters:
key
- key with which the specified value is to be associatedvalues
- value to be add to association with the specified key- Returns:
- this instance of
Parameters
-
add
WebClientRequestHeaders add(String key, Iterable<String> values)
Description copied from interface:Parameters
Adds specified values tu association with the specified key (optional operation). If parameters doesn't contains mapping, new mapping is created.- Specified by:
add
in interfaceParameters
- Parameters:
key
- key with which the specified value is to be associatedvalues
- value to be add to association with the specified key. Ifnull
then noting will be add.- Returns:
- this instance of
Parameters
-
addAll
WebClientRequestHeaders addAll(Parameters parameters)
Description copied from interface:Parameters
Copies all of the mappings from the specifiedparameters
to this instance adding values to existing associations (optional operation).- Specified by:
addAll
in interfaceParameters
- Parameters:
parameters
- to copy.- Returns:
- this instance of
Parameters
-
-