| Modifier and Type | Class and Description |
|---|---|
| public static interface | ServerResponse.
Defines a builder that adds a body to the response. |
| public static interface | ServerResponse.
Defines the context used during the |
| public static interface | ServerResponse.
the builder subclass B extends ServerResponse.Defines a builder that adds headers to the response. |
| Modifier and Type | Method and Description |
|---|---|
| public static ServerResponse. | |
| public static ServerResponse. | |
| public MultiValueMap | |
| public static ServerResponse. | Returns: the created builderthe location URI location)Create a new builder with a 201 Created status and a location header set to the given URI. |
| public static ServerResponse. | Returns: the created builderthe response to copy the status and headers from other)Create a builder with the status code and headers of the given response. |
| public static Mono | Returns: Mono with the built responsethe response)ErrorResponse to initialize fromCreate a |
| public HttpHeaders | |
| public static ServerResponse. | |
| public static ServerResponse. | |
| public static ServerResponse. | |
| public static ServerResponse. | Returns: the created builderthe location URI location)Create a builder with a 308 Permanent Redirect status and a location header set to the given URI. |
| public int | Returns: the status as an integer
Deprecated
since 6.0. as of 6.0, in favor of
statusCode()
Return the status code of this response as integer. |
| public static ServerResponse. | Returns: the created builderthe location URI location)Create a builder with a 303 See Other status and a location header set to the given URI. |
| public static ServerResponse. | Returns: the created builderthe response status status)Create a builder with the given HTTP status. |
| public static ServerResponse. | Returns: the created builderthe response status status)Create a builder with the given HTTP status. |
| public HttpStatusCode | |
| public static ServerResponse. | Returns: the created builderthe location URI location)Create a builder with a 307 Temporary Redirect status and a location header set to the given URI. |
| public static ServerResponse. | Returns: the created builderCreate a builder with an 422 Unprocessable Entity status. |
| public Mono | Returns: Mono<Void> to indicate when writing is completethe web exchange to write to exchange, ServerResponse.the context to use when writing contextWrite this response to the given web exchange. |
| accepted | back to summary |
|---|---|
| public static ServerResponse. Create a builder with an 202 Accepted status.
| |
| badRequest | back to summary |
|---|---|
| public static ServerResponse. Create a builder with a 400 Bad Request status.
| |
| cookies | back to summary |
|---|---|
| public MultiValueMap Return the cookies of this response. | |
| created | back to summary |
|---|---|
| public static ServerResponse. Create a new builder with a 201 Created status and a location header set to the given URI.
| |
| from | back to summary |
|---|---|
| public static ServerResponse. Create a builder with the status code and headers of the given response.
| |
| from | back to summary |
|---|---|
| public static Mono Create a
| |
| headers | back to summary |
|---|---|
| public HttpHeaders headers() Return the headers of this response. | |
| noContent | back to summary |
|---|---|
| public static ServerResponse. Create a builder with a 204 No Content status.
| |
| notFound | back to summary |
|---|---|
| public static ServerResponse. Create a builder with a 404 Not Found status.
| |
| ok | back to summary |
|---|---|
| public static ServerResponse. Create a builder with the status set to 200 OK.
| |
| permanentRedirect | back to summary |
|---|---|
| public static ServerResponse. Create a builder with a 308 Permanent Redirect status and a location header set to the given URI.
| |
| rawStatusCode | back to summary |
|---|---|
| public int rawStatusCode()
Return the status code of this response as integer.
| |
| seeOther | back to summary |
|---|---|
| public static ServerResponse. Create a builder with a 303 See Other status and a location header set to the given URI.
| |
| status | back to summary |
|---|---|
| public static ServerResponse. Create a builder with the given HTTP status.
| |
| status | back to summary |
|---|---|
| public static ServerResponse. Create a builder with the given HTTP status.
| |
| statusCode | back to summary |
|---|---|
| public HttpStatusCode statusCode() Return the status code of this response.
| |
| temporaryRedirect | back to summary |
|---|---|
| public static ServerResponse. Create a builder with a 307 Temporary Redirect status and a location header set to the given URI.
| |
| unprocessableEntity | back to summary |
|---|---|
| public static ServerResponse. Create a builder with an 422 Unprocessable Entity status.
| |
| writeTo | back to summary |
|---|---|
| public Mono Write this response to the given web exchange.
| |
| Modifier and Type | Method and Description |
|---|---|
| public < the type of the elements contained in the publisher T, the type of the P extends PublisherPublisher | |
| public < the type of the elements contained in the publisher T, the type of the P extends PublisherPublisher | Returns: the built responsethe publisher, ParameterizedTypeReference<T> Publisher to use to write the responsethe type of elements produced elementTypeRef)Variant of |
| public Mono | Returns: the built responsethe producer to write to the request producer, Class<?> the type of elements produced elementClass)Variant of |
| public Mono | Returns: the built responsethe producer to write to the response producer, ParameterizedTypeReference<?> the type of elements produced elementTypeRef)Variant of |
| public Mono | Returns: the built responsethe inserter)BodyInserter that writes to the responseSet the body of the response to the given |
| public Mono | |
| public ServerResponse. | Returns: this builderthe content length contentLength)Set the length of the body in bytes, as specified by the
|
| public ServerResponse. | Returns: this builderthe content type contentType)Set the media type of the body, as specified by the
|
| public ServerResponse. | hint(String
the hint key key, Object the hint value value)Add a serialization hint like |
| public ServerResponse. | |
| public Mono | |
| public Mono | |
| public Mono | syncBody(Object body)
Deprecated
as of Spring Framework 5.2 in favor of
bodyValue(Object)
Set the response body to the given |
| body | back to summary |
|---|---|
| public <T, P extends Publisher Set the body from the given
| |
| body | back to summary |
|---|---|
| public <T, P extends Publisher Variant of
| |
| body | back to summary |
|---|---|
| public Mono Variant of
| |
| body | back to summary |
|---|---|
| public Mono Variant of
| |
| body | back to summary |
|---|---|
| public Mono Set the body of the response to the given
| |
| bodyValue | back to summary |
|---|---|
| public Mono Set the body of the response to the given
| |
| contentLength | back to summary |
|---|---|
| public ServerResponse. Set the length of the body in bytes, as specified by the
| |
| contentType | back to summary |
|---|---|
| public ServerResponse. Set the media type of the body, as specified by the
| |
| hint | back to summary |
|---|---|
| public ServerResponse. Add a serialization hint like | |
| hints | back to summary |
|---|---|
| public ServerResponse. Customize the serialization hints with the given consumer.
| |
| render | back to summary |
|---|---|
| public Mono Render the template with the given Note Empty
| |
| render | back to summary |
|---|---|
| public Mono Render the template with the given
| |
| syncBody | back to summary |
|---|---|
| public Mono Deprecated as of Spring Framework 5.2 in favor of Set the response body to the given
| |
writeTo(ServerWebExchange, Context).
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: the list of message writersReturn the |
| public List | Returns: the list of view resolversReturn the |
| messageWriters | back to summary |
|---|---|
| public List Return the
| |
| viewResolvers | back to summary |
|---|---|
| public List Return the
| |
| Modifier and Type | Method and Description |
|---|---|
| public B | Returns: this builderthe allowed methods allowedMethods)Set the set of allowed |
| public B | Returns: this builderthe allowed methods allowedMethods)Set the set of allowed |
| public Mono | |
| public Mono | |
| public Mono | build(BiFunction<ServerWebExchange, ServerResponse.
the function used to write to the writeFunctionServerWebExchangeBuild the response entity with a custom writer function. |
| public B | Returns: this buildera builder for cache-related HTTP response headers cacheControl)Set the caching directives for the resource, as specified by the HTTP 1.1
|
| public B | Returns: this builderthe cookie to add cookie)Add the given cookie to the response. |
| public B | Returns: this buildera function that consumes the cookies cookiesConsumer)Manipulate this response's cookies with the given consumer. |
| public B | |
| public B | |
| public B | Returns: this buildera function that consumes the headersConsumer)HttpHeadersManipulate this response's headers with the given consumer. |
| public B | Returns: this builderthe last modified date lastModified)Set the time the resource was last changed, as specified by the
|
| public B | Returns: this builderthe last modified date lastModified)Set the time the resource was last changed, as specified by the
|
| public B | |
| public B | Returns: this builderrequest header names requestHeaders)Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. |
| allow | back to summary |
|---|---|
| public B allow(HttpMethod... allowedMethods) Set the set of allowed
| |
| allow | back to summary |
|---|---|
| public B allow(Set<HttpMethod> allowedMethods) Set the set of allowed
| |
| build | back to summary |
|---|---|
| public Mono Build the response entity with no body. | |
| build | back to summary |
|---|---|
| public Mono Build the response entity with no body. The response will be committed when the given | |
| build | back to summary |
|---|---|
| public Mono Build the response entity with a custom writer function.
| |
| cacheControl | back to summary |
|---|---|
| public B cacheControl(CacheControl cacheControl) Set the caching directives for the resource, as specified by the HTTP 1.1
A
| |
| cookie | back to summary |
|---|---|
| public B cookie(ResponseCookie cookie) Add the given cookie to the response.
| |
| cookies | back to summary |
|---|---|
| public B cookies(Consumer<MultiValueMap<String, ResponseCookie>> cookiesConsumer) Manipulate this response's cookies with the given consumer. The
cookies provided to the consumer are "live", so that the consumer can be used to
overwrite existing cookies,
remove cookies, or use any of the other
| |
| eTag | back to summary |
|---|---|
| public B eTag(String eTag) Set the entity tag of the body, as specified by the
| |
| header | back to summary |
|---|---|
| public B header(String headerName, String... headerValues) Add the given header value(s) under the given name.
| |
| headers | back to summary |
|---|---|
| public B headers(Consumer<HttpHeaders> headersConsumer) Manipulate this response'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 other
| |
| lastModified | back to summary |
|---|---|
| public B lastModified(ZonedDateTime lastModified) Set the time the resource was last changed, as specified by the
| |
| lastModified | back to summary |
|---|---|
| public B lastModified(Instant lastModified) Set the time the resource was last changed, as specified by the
| |
| location | back to summary |
|---|---|
| public B location(URI location) Set the location of a resource, as specified by the
| |
| varyBy | back to summary |
|---|---|
| public B varyBy(String... requestHeaders) Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. The configured request header names are added only if not already present in the response "Vary" header.
| |