spring-framework / org.springframework.web.reactive.function.server / bodyValueAndAwait

bodyValueAndAwait

suspend fun BodyBuilder.bodyValueAndAwait(body: Any): ServerResponse

Coroutines variant of ServerResponse.BodyBuilder.bodyValue.

Set the body of the response to the given {@code Object} and return it. This convenience method combines body and org.springframework.web.reactive.function.BodyInserters.fromValue.

Parameters

body - the body of the response

Exceptions

IllegalArgumentException - if body is a Publisher or an instance of a type supported by org.springframework.core.ReactiveAdapterRegistry.getSharedInstance,

Return
the built response