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 Baccept(MediaType... acceptableMediaTypes)Set the list of acceptable media types, as specified by theAcceptheader.BacceptCharset(Charset... acceptableCharsets)Set the list of acceptable charsets, as specified by theAccept-Charsetheader.RequestEntity<Void>build()Builds the request entity with no body.Bheader(String headerName, String... headerValues)Add the given, single header value under the given name.BifModifiedSince(long ifModifiedSince)Set the value of theIf-Modified-Sinceheader.BifNoneMatch(String... ifNoneMatches)Set the values of theIf-None-Matchheader.
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 theAcceptheader.- Parameters:
acceptableMediaTypes- the acceptable media types
acceptCharset
B acceptCharset(Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified by theAccept-Charsetheader.- Parameters:
acceptableCharsets- the acceptable charsets
ifModifiedSince
B ifModifiedSince(long ifModifiedSince)
Set the value of theIf-Modified-Sinceheader.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-Matchheader.- 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)