spring-framework / org.springframework.web.reactive.function.client / body

body

fun <reified T : Any, S : Publisher<T>> RequestBodySpec.body(publisher: S): RequestHeadersSpec<*>

Extension for WebClient.RequestBodySpec.body providing a body(Publisher<T>) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Author
Sebastien Deleuze

Since
5.0

fun <reified T : Any> RequestBodySpec.body(flow: Flow<T>): RequestHeadersSpec<*>

Extension for WebClient.RequestBodySpec.body providing a body(Flow<T>) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Parameters

flow - the Flow to write to the request

T - the type of the elements contained in the flow

Author
Sebastien Deleuze

Since
5.2

fun <reified T : Any> RequestBodySpec.body(producer: Any): RequestHeadersSpec<*>

Extension for WebClient.RequestBodySpec.body providing a body<T>(Any) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Parameters

producer - the producer to write to the request. This must be a Publisher or another producer adaptable to a Publisher via org.springframework.core.ReactiveAdapterRegistry

T - the type of the elements contained in the producer

Author
Sebastien Deleuze

Since
5.2