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

bodyWithType

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

Extension for WebClient.RequestBodySpec.body providing a bodyWithType<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

Parameters

Author
Sebastien Deleuze

Since
5.2

inline fun <reified T : Any> RequestBodySpec.bodyWithType(publisher: Publisher<T>): RequestHeadersSpec<*>

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

Parameters

publisher - the Publisher to write to the request

Parameters

Author
Sebastien Deleuze

Since
5.2

@ExperimentalCoroutinesApi inline fun <reified T : Any> RequestBodySpec.bodyWithType(flow: Flow<T>): RequestHeadersSpec<*>

Extension for WebClient.RequestBodySpec.body providing a bodyWithType(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

Parameters

Author
Sebastien Deleuze

Since
5.2