B
- the builder subclasspublic static interface Response.HeadersBuilder<B extends Response.HeadersBuilder<B>>
Modifier and Type | Method and Description |
---|---|
B |
allow(org.springframework.http.HttpMethod... allowedMethods)
Set the set of allowed
HTTP methods , as specified
by the Allow header. |
Response<Void> |
build()
Build the response entity with no body.
|
<T extends org.reactivestreams.Publisher<Void>> |
build(T voidPublisher)
Build the response entity with no body.
|
B |
cacheControl(org.springframework.http.CacheControl cacheControl)
Set the caching directives for the resource, as specified by the HTTP 1.1
Cache-Control header. |
B |
eTag(String eTag)
Set the entity tag of the body, as specified by the
ETag header. |
B |
header(String headerName,
String... headerValues)
Add the given header value(s) under the given name.
|
B |
headers(org.springframework.http.HttpHeaders headers)
Copy the given headers into the entity's headers map.
|
B |
lastModified(ZonedDateTime lastModified)
Set the time the resource was last changed, as specified by the
Last-Modified header. |
B |
location(URI location)
Set the location of a resource, as specified by the
Location header. |
B |
varyBy(String... requestHeaders)
Configure one or more request header names (e.g.
|
B header(String headerName, String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
B headers(org.springframework.http.HttpHeaders headers)
headers
- the existing HttpHeaders to copy fromHttpHeaders.add(String, String)
B allow(org.springframework.http.HttpMethod... allowedMethods)
HTTP methods
, as specified
by the Allow
header.allowedMethods
- the allowed methodsHttpHeaders.setAllow(Set)
B eTag(String eTag)
ETag
header.eTag
- the new entity tagHttpHeaders.setETag(String)
B lastModified(ZonedDateTime lastModified)
Last-Modified
header.
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
lastModified
- the last modified dateHttpHeaders.setLastModified(long)
B location(URI location)
Location
header.location
- the locationHttpHeaders.setLocation(URI)
B cacheControl(org.springframework.http.CacheControl cacheControl)
Cache-Control
header.
A CacheControl
instance can be built like
CacheControl.maxAge(3600).cachePublic().noTransform()
.
cacheControl
- a builder for cache-related HTTP response headersB varyBy(String... requestHeaders)
requestHeaders
- request header names<T extends org.reactivestreams.Publisher<Void>> Response<T> build(T voidPublisher)
voidPublisher
completes.voidPublisher
- publisher publisher to indicate when the response should be committed