public interface ServerWebExchange
Modifier and Type | Method and Description |
---|---|
boolean |
checkNotModified(Instant lastModified)
An overloaded variant of
checkNotModified(String, Instant) with
a last-modified timestamp only. |
boolean |
checkNotModified(String etag)
An overloaded variant of
checkNotModified(String, Instant) with
an ETag (entity tag) value only. |
boolean |
checkNotModified(String etag,
Instant lastModified)
Check whether the requested resource has been modified given the supplied
ETag (entity tag) and last-modified timestamp as determined by
the application. |
<T> Optional<T> |
getAttribute(String name)
Return the request attribute value if present.
|
Map<String,Object> |
getAttributes()
Return a mutable map of request attributes for the current exchange.
|
ServerHttpRequest |
getRequest()
Return the current HTTP request.
|
ServerHttpResponse |
getResponse()
Return the current HTTP response.
|
reactor.core.publisher.Mono<WebSession> |
getSession()
Return the web session for the current request.
|
boolean |
isNotModified()
Returns
true if the one of the checkNotModified methods
in this contract were used and they returned true. |
ServerHttpRequest getRequest()
ServerHttpResponse getResponse()
Map<String,Object> getAttributes()
<T> Optional<T> getAttribute(String name)
T
- the attribute typename
- the attribute namereactor.core.publisher.Mono<WebSession> getSession()
WebSession
for more details.boolean isNotModified()
true
if the one of the checkNotModified
methods
in this contract were used and they returned true.boolean checkNotModified(Instant lastModified)
checkNotModified(String, Instant)
with
a last-modified timestamp only.lastModified
- the last-modified timeboolean checkNotModified(String etag)
checkNotModified(String, Instant)
with
an ETag
(entity tag) value only.etag
- the entity tag for the underlying resource.boolean checkNotModified(String etag, Instant lastModified)
ETag
(entity tag) and last-modified timestamp as determined by
the application. Also transparently prepares the response, setting HTTP
status, and adding "ETag" and "Last-Modified" headers when applicable.
This method works with conditional GET/HEAD requests as well as with
conditional POST/PUT/DELETE requests.
Note: The HTTP specification recommends setting both
ETag and Last-Modified values, but you can also use
#checkNotModified(String)
or
checkNotModified(Instant)
.
etag
- the entity tag that the application determined for the
underlying resource. This parameter will be padded with quotes (")
if necessary.lastModified
- the last-modified timestamp that the application
determined for the underlying resource