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 SummaryModifier and TypeMethodDescriptionSet 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(Consumer<HttpHeaders> headersConsumer) Manipulate this entity's headers with the given consumer.headers(HttpHeaders headers) Copy the given headers into the entity's headers map.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.
- 
Method Details- 
headerAdd the given, single header value under the given name.- Parameters:
- headerName- the header name
- headerValues- the header value(s)
- Returns:
- this builder
- See Also:
 
- 
headersCopy the given headers into the entity's headers map.- Parameters:
- headers- the existing HttpHeaders to copy from
- Returns:
- this builder
- Since:
- 5.2
- See Also:
 
- 
headersManipulate 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.- Parameters:
- headersConsumer- a function that consumes the- HttpHeaders
- Returns:
- this builder
- Since:
- 5.2
 
- 
acceptSet the list of acceptable media types, as specified by theAcceptheader.- Parameters:
- acceptableMediaTypes- the acceptable media types
 
- 
acceptCharsetSet the list of acceptable charsets, as specified by theAccept-Charsetheader.- Parameters:
- acceptableCharsets- the acceptable charsets
 
- 
ifModifiedSinceSet the value of theIf-Modified-Sinceheader.- Parameters:
- ifModifiedSince- the new value of the header
- Since:
- 5.1.4
 
- 
ifModifiedSinceSet the value of theIf-Modified-Sinceheader.- Parameters:
- ifModifiedSince- the new value of the header
- Since:
- 5.1.4
 
- 
ifModifiedSinceSet 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
 
- 
ifNoneMatchSet the values of theIf-None-Matchheader.- Parameters:
- ifNoneMatches- the new value of the header
 
- 
buildRequestEntity<Void> build()Builds the request entity with no body.- Returns:
- the request entity
- See Also:
 
 
-