接口 RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
- 类型参数:
B
- the builder subclass
- 所有已知子接口:
RequestEntity.BodyBuilder
- 封闭类:
- RequestEntity<T>
public static interface RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
Defines a builder that adds headers to the request entity.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 B
accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as specified by theAccept
header.B
acceptCharset(Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified by theAccept-Charset
header.RequestEntity<Void>
build()
Builds the request entity with no body.B
header(String headerName, String... headerValues)
Add the given, single header value under the given name.B
ifModifiedSince(long ifModifiedSince)
Set the value of theIf-Modified-Since
header.B
ifNoneMatch(String... ifNoneMatches)
Set the values of theIf-None-Match
header.
方法详细资料
header
B header(String headerName, String... headerValues)
Add the given, single header value under the given name.- 参数:
headerName
- the header nameheaderValues
- the header value(s)- 返回:
- this builder
- 另请参阅:
HttpHeaders.add(String, String)
accept
B accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as specified by theAccept
header.- 参数:
acceptableMediaTypes
- the acceptable media types
acceptCharset
B acceptCharset(Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified by theAccept-Charset
header.- 参数:
acceptableCharsets
- the acceptable charsets
ifModifiedSince
B ifModifiedSince(long ifModifiedSince)
Set the value of theIf-Modified-Since
header.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- 参数:
ifModifiedSince
- the new value of the header
ifNoneMatch
B ifNoneMatch(String... ifNoneMatches)
Set the values of theIf-None-Match
header.- 参数:
ifNoneMatches
- the new value of the header
build
RequestEntity<Void> build()
Builds the request entity with no body.- 返回:
- the request entity
- 另请参阅:
RequestEntity.BodyBuilder.body(Object)