ServerResponse.BodyBuilder implementation.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract static class | DefaultServerResponseBuilder.
Abstract base class for |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final MultiValueMap | |
| private final HttpHeaders | |
| private final Map | |
| private final HttpStatusCode |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ServerResponse. | allow(HttpMethod...
the allowed methods allowedMethods)Implements org. Set the set of allowed |
| public ServerResponse. | allow(Set<HttpMethod>
the allowed methods allowedMethods)Implements org. Set the set of allowed |
| public <T, P extends Publisher | body(P
the publisher, Class<T> Publisher to write to the responsethe type of elements published elementClass)Implements org. Set the body from the given |
| public <T, P extends Publisher | body(P
the publisher, ParameterizedTypeReference<T> Publisher to use to write the responsethe type of elements produced typeRef)Implements org. Variant of |
| public Mono | body(Object
the producer to write to the request producer, Class<?> the type of elements produced elementClass)Implements org. Variant of |
| public Mono | body(Object
the producer to write to the response producer, ParameterizedTypeReference<?> the type of elements produced elementTypeRef)Implements org. Variant of |
| public Mono | body(BodyInserter<?, ? super ServerHttpResponse>
the inserter)BodyInserter that writes to the responseImplements org. Set the body of the response to the given |
| public Mono | bodyValue(Object
the body of the response body)Implements org. Set the body of the response to the given |
| public Mono | build()
Implements org. Build the response entity with no body. |
| public Mono | build(Publisher<Void>
the publisher to indicate when the response should be committed voidPublisher)Implements org. Build the response entity with no body. |
| public Mono | build(BiFunction<ServerWebExchange, ServerResponse.
the function used to write to the writeFunctionServerWebExchangeImplements org. Build the response entity with a custom writer function. |
| public ServerResponse. | cacheControl(CacheControl
a builder for cache-related HTTP response headers cacheControl)Implements org. Set the caching directives for the resource, as specified by the HTTP 1.1
|
| public ServerResponse. | contentLength(long
the content length contentLength)Implements org. Set the length of the body in bytes, as specified by the
|
| public ServerResponse. | contentType(MediaType
the content type contentType)Implements org. Set the media type of the body, as specified by the
|
| public ServerResponse. | cookie(ResponseCookie
the cookie to add cookie)Implements org. Add the given cookie to the response. |
| public ServerResponse. | cookies(Consumer<MultiValueMap<String, ResponseCookie>>
a function that consumes the cookies cookiesConsumer)Implements org. Manipulate this response's cookies with the given consumer. |
| public ServerResponse. | eTag(String
the new entity tag etag)Implements org. Set the entity tag of the body, as specified by the |
| public ServerResponse. | header(String
the header name headerName, String... the header value(s) headerValues)Implements org. Add the given header value(s) under the given name. |
| public ServerResponse. | headers(Consumer<HttpHeaders>
a function that consumes the headersConsumer)HttpHeadersImplements org. Manipulate this response's headers with the given consumer. |
| public ServerResponse. | hint(String
the hint key key, Object the hint value value)Implements org. Add a serialization hint like |
| public ServerResponse. | |
| private <T> Mono | |
| public ServerResponse. | lastModified(ZonedDateTime
the last modified date lastModified)Implements org. Set the time the resource was last changed, as specified by the
|
| public ServerResponse. | lastModified(Instant
the last modified date lastModified)Implements org. Set the time the resource was last changed, as specified by the
|
| public ServerResponse. | location(URI
the location location)Implements org. Set the location of a resource, as specified by the |
| public Mono | render(String
the name of the template to be rendered name, Object... the modelAttributes used to render the template modelAttributes)Implements org. Render the template with the given |
| public Mono | render(String
the name of the template to be rendered name, Map<String, ?> the model used to render the template model)Implements org. Render the template with the given |
| public Mono | syncBody(Object body)
Implements org.
Deprecated
Set the response body to the given |
| public ServerResponse. | varyBy(String...
request header names requestHeaders)Implements org. 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. |