public interface ServerHttpResponse extends ReactiveHttpOutputMessage
Modifier and Type | Method and Description |
---|---|
java.lang.String |
encodeUrl(java.lang.String url)
A mechanism for URL rewriting that applications and libraries such as
HTML template libraries to use consistently for all URLs emitted by
the application.
|
MultiValueMap<java.lang.String,ResponseCookie> |
getCookies()
Return a mutable map with the cookies to send to the server.
|
HttpStatus |
getStatusCode()
Return the HTTP status code or
null if not set. |
void |
registerUrlEncoder(java.util.function.Function<java.lang.String,java.lang.String> encoder)
Register a URL rewriting function for use with
encodeUrl(java.lang.String) . |
boolean |
setStatusCode(HttpStatus status)
Set the HTTP status code of the response.
|
beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith
getHeaders
boolean setStatusCode(HttpStatus status)
status
- the HTTP status as an HttpStatus
enum valuefalse
if the status code has not been set because the HTTP response
is already committed, true
if it has been set correctly.HttpStatus getStatusCode()
null
if not set.MultiValueMap<java.lang.String,ResponseCookie> getCookies()
java.lang.String encodeUrl(java.lang.String url)
registerUrlEncoder(java.util.function.Function<java.lang.String, java.lang.String>)
that can insert an id for authentication,
a nonce for CSRF protection, a version for a static resource, etc.url
- the URL to encodevoid registerUrlEncoder(java.util.function.Function<java.lang.String,java.lang.String> encoder)
encodeUrl(java.lang.String)
.
The function must return an encoded URL or the same URL.encoder
- a URL encoding function to use