Package org.springframework.http
Interface RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
- Type Parameters:
B
- the builder subclass
- All Known Subinterfaces:
RequestEntity.BodyBuilder
- Enclosing class:
- RequestEntity<T>
public static interface RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
Defines a builder that adds headers to the request entity.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
Method Detail
header
B header(String headerName, String... headerValues)
Add the given, single header value under the given name.- Parameters:
headerName
- the header nameheaderValues
- the header value(s)- Returns:
- this builder
- See Also:
HttpHeaders.add(String, String)
accept
B accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as specified by theAccept
header.- Parameters:
acceptableMediaTypes
- the acceptable media types
acceptCharset
B acceptCharset(Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified by theAccept-Charset
header.- Parameters:
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.
- Parameters:
ifModifiedSince
- the new value of the header
ifNoneMatch
B ifNoneMatch(String... ifNoneMatches)
Set the values of theIf-None-Match
header.- Parameters:
ifNoneMatches
- the new value of the header
build
RequestEntity<Void> build()
Builds the request entity with no body.- Returns:
- the request entity
- See Also:
RequestEntity.BodyBuilder.body(Object)