suspend fun BodyBuilder.bodyAndAwait(body: Any): ServerResponse
Coroutines variant of ServerResponse.BodyBuilder.body with an Any parameter.
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.fromObject.
body
- the body of the response
IllegalArgumentException
- if body
is a Publisher or an
instance of a type supported by org.springframework.core.ReactiveAdapterRegistry.getSharedInstance,
Return
the built response
@ExperimentalCoroutinesApi suspend inline fun <reified T : Any> BodyBuilder.bodyAndAwait(flow: Flow<T>): ServerResponse
Coroutines variant of ServerResponse.BodyBuilder.body with Any and
ParameterizedTypeReference parameters providing a bodyAndAwait(Flow<T>)
variant.
This extension is not subject to type erasure and retains actual generic type arguments.
Author
Sebastien Deleuze
Since
5.2