接口 RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
- 类型参数:
B- the builder subclass
- 所有已知子接口:
RequestEntity.BodyBuilder
- 所有已知实现类:
RequestEntity.DefaultBodyBuilder
- 封闭类:
- RequestEntity<T>
public static interface RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
Defines a builder that adds headers to the request entity.
-
方法概要
修饰符和类型方法说明Set the list of acceptable media types, as specified by theAcceptheader.acceptCharset(Charset... acceptableCharsets) Set the list of acceptable charsets, as specified by theAccept-Charsetheader.build()Builds the request entity with no body.Add the given, single header value under the given name.headers(HttpHeaders headers) Copy the given headers into the entity's headers map.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this entity's headers with the given consumer.ifModifiedSince(long ifModifiedSince) Set the value of theIf-Modified-Sinceheader.ifModifiedSince(Instant ifModifiedSince) Set the value of theIf-Modified-Sinceheader.ifModifiedSince(ZonedDateTime ifModifiedSince) Set the value of theIf-Modified-Sinceheader.ifNoneMatch(String... ifNoneMatches) Set the values of theIf-None-Matchheader.
-
方法详细资料
-
header
Add the given, single header value under the given name.- 参数:
headerName- the header nameheaderValues- the header value(s)- 返回:
- this builder
- 另请参阅:
-
headers
Copy the given headers into the entity's headers map.- 参数:
headers- the existing HttpHeaders to copy from- 返回:
- this builder
- 另请参阅:
-
headers
Manipulate this entity's headers with the given consumer. The headers provided to the consumer are "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the otherHttpHeadersmethods.- 参数:
headersConsumer- a function that consumes theHttpHeaders- 返回:
- this builder
-
accept
Set the list of acceptable media types, as specified by theAcceptheader.- 参数:
acceptableMediaTypes- the acceptable media types
-
acceptCharset
Set the list of acceptable charsets, as specified by theAccept-Charsetheader.- 参数:
acceptableCharsets- the acceptable charsets
-
ifModifiedSince
Set the value of theIf-Modified-Sinceheader.- 参数:
ifModifiedSince- the new value of the header
-
ifModifiedSince
Set the value of theIf-Modified-Sinceheader.- 参数:
ifModifiedSince- the new value of the header
-
ifModifiedSince
Set the value of theIf-Modified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- 参数:
ifModifiedSince- the new value of the header
-
ifNoneMatch
Set the values of theIf-None-Matchheader.- 参数:
ifNoneMatches- the new value of the header
-
build
RequestEntity<Void> build()Builds the request entity with no body.- 返回:
- the request entity
- 另请参阅:
-