spring-framework
5.3.39

# Package org.springframework.web.reactive.function.server

## Types

CoRouterFunctionDsl
Link copied to clipboard
class CoRouterFunctionDsl
Content copied to clipboard

Provide a WebFlux.fn RouterFunction Coroutines Kotlin DSL created by `coRouter { }` in order to be able to write idiomatic Kotlin code.

RouterFunctionDsl
Link copied to clipboard
class RouterFunctionDsl
Content copied to clipboard

Provide a WebFlux.fn RouterFunction Reactive Kotlin DSL created by `router { }` in order to be able to write idiomatic Kotlin code.

## Functions

attributeOrNull
Link copied to clipboard
fun ServerRequest.attributeOrNull(name: String): Any?
Content copied to clipboard

Nullable variant of ServerRequest.attribute

awaitBody
Link copied to clipboard
inline suspend fun <T : Any> ServerRequest.awaitBody(): T
Content copied to clipboard

Non-nullable Coroutines variant of ServerRequest.bodyToMono.

suspend fun <T : Any> ServerRequest.awaitBody(clazz: KClass<T>): T
Content copied to clipboard

`KClass` non-nullable Coroutines variant of ServerRequest.bodyToMono. Please consider `awaitBody<Foo>` variant if possible.

awaitBodyOrNull
Link copied to clipboard
inline suspend fun <T : Any> ServerRequest.awaitBodyOrNull(): T?
Content copied to clipboard

Nullable Coroutines variant of ServerRequest.bodyToMono.

suspend fun <T : Any> ServerRequest.awaitBodyOrNull(clazz: KClass<T>): T?
Content copied to clipboard

`KClass` nullable Coroutines variant of ServerRequest.bodyToMono. Please consider `awaitBodyOrNull<Foo>` variant if possible.

awaitFormData
Link copied to clipboard
suspend fun ServerRequest.awaitFormData(): MultiValueMap<String, String>
Content copied to clipboard

Coroutines variant of ServerRequest.formData.

awaitMultipartData
Link copied to clipboard
suspend fun ServerRequest.awaitMultipartData(): MultiValueMap<String, Part>
Content copied to clipboard

Coroutines variant of ServerRequest.multipartData.

awaitPrincipal
Link copied to clipboard
suspend fun ServerRequest.awaitPrincipal(): Principal?
Content copied to clipboard

Coroutines variant of ServerRequest.principal.

awaitSession
Link copied to clipboard
suspend fun ServerRequest.awaitSession(): WebSession
Content copied to clipboard

Coroutines variant of ServerRequest.session.

body
Link copied to clipboard
inline fun <T : Any> ServerResponse.BodyBuilder.body(producer: Any): Mono<ServerResponse>
Content copied to clipboard

Extension for ServerResponse.BodyBuilder.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.

inline fun <T : Any> ServerResponse.BodyBuilder.body(publisher: Publisher<T>): Mono<ServerResponse>
Content copied to clipboard

Extension for ServerResponse.BodyBuilder.body providing a `body(Publisher<T>)` variant. This extension is not subject to type erasure and retains actual generic type arguments.

bodyAndAwait
Link copied to clipboard
inline suspend fun <T : Any> ServerResponse.BodyBuilder.bodyAndAwait(flow: Flow<T>): ServerResponse
Content copied to clipboard

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.

bodyToFlow
Link copied to clipboard
inline fun <T : Any> ServerRequest.bodyToFlow(): Flow<T>
Content copied to clipboard

Coroutines kotlinx.coroutines.flow.Flow based variant of ServerRequest.bodyToFlux.

fun <T : Any> ServerRequest.bodyToFlow(clazz: KClass<T>): Flow<T>
Content copied to clipboard

`KClass` coroutines kotlinx.coroutines.flow.Flow based variant of ServerRequest.bodyToFlux. Please consider `bodyToFlow<Foo>` variant if possible.

bodyToFlux
Link copied to clipboard
inline fun <T : Any> ServerRequest.bodyToFlux(): Flux<T>
Content copied to clipboard

Extension for ServerRequest.bodyToFlux providing a `bodyToFlux<Foo>()` variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

bodyToMono
Link copied to clipboard
inline fun <T : Any> ServerRequest.bodyToMono(): Mono<T>
Content copied to clipboard

Extension for ServerRequest.bodyToMono providing a `bodyToMono<Foo>()` variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

bodyToServerSentEvents
Link copied to clipboard
inline fun <T : Any> ServerResponse.BodyBuilder.bodyToServerSentEvents(publisher: Publisher<T>): Mono<ServerResponse>
Content copied to clipboard

Extension for ServerResponse.BodyBuilder.body providing a `bodyToServerSentEvents(Publisher<T>)` variant. This extension is not subject to type erasure and retains actual generic type arguments.

bodyValueAndAwait
Link copied to clipboard
suspend fun ServerResponse.BodyBuilder.bodyValueAndAwait(body: Any): ServerResponse
Content copied to clipboard

Coroutines variant of ServerResponse.BodyBuilder.bodyValue.

buildAndAwait
Link copied to clipboard
suspend fun RenderingResponse.Builder.buildAndAwait(): RenderingResponse
Content copied to clipboard

Coroutines variant of RenderingResponse.Builder.build.

suspend fun ServerResponse.HeadersBuilder<out ServerResponse.HeadersBuilder<*>>.buildAndAwait(): ServerResponse
Content copied to clipboard

Coroutines variant of ServerResponse.HeadersBuilder.build.

contentLengthOrNull
Link copied to clipboard
fun ServerRequest.Headers.contentLengthOrNull(): Long?
Content copied to clipboard

Nullable variant of ServerRequest.Headers.contentLength

contentTypeOrNull
Link copied to clipboard
fun ServerRequest.Headers.contentTypeOrNull(): MediaType?
Content copied to clipboard

Nullable variant of ServerRequest.Headers.contentType

coRouter
Link copied to clipboard
fun coRouter(routes: CoRouterFunctionDsl.() -> Unit): RouterFunction<ServerResponse>
Content copied to clipboard

Allow to create easily a WebFlux.fn RouterFunction with a Coroutines router Kotlin DSL.

html
Link copied to clipboard
fun ServerResponse.BodyBuilder.html(): ServerResponse.BodyBuilder
Content copied to clipboard

Shortcut for setting MediaType.TEXT_HTML `Content-Type` header.

json
Link copied to clipboard
fun ServerResponse.BodyBuilder.json(): ServerResponse.BodyBuilder
Content copied to clipboard

Shortcut for setting MediaType.APPLICATION_JSON `Content-Type` header.

plus
Link copied to clipboard
operator fun <T : ServerResponse> RouterFunction<T>.plus(other: RouterFunction<T>): RouterFunction<T>
Content copied to clipboard

Equivalent to RouterFunction.and.

queryParamOrNull
Link copied to clipboard
fun ServerRequest.queryParamOrNull(name: String): String?
Content copied to clipboard

Nullable variant of ServerRequest.queryParam

remoteAddressOrNull
Link copied to clipboard
fun ServerRequest.remoteAddressOrNull(): InetSocketAddress?
Content copied to clipboard

Nullable variant of ServerRequest.remoteAddress

renderAndAwait
Link copied to clipboard
suspend fun ServerResponse.BodyBuilder.renderAndAwait(name: String, vararg modelAttributes: String): ServerResponse
Content copied to clipboard
suspend fun ServerResponse.BodyBuilder.renderAndAwait(name: String, model: Map<String, *>): ServerResponse
Content copied to clipboard

Coroutines variant of ServerResponse.BodyBuilder.render.

router
Link copied to clipboard
fun router(routes: RouterFunctionDsl.() -> Unit): RouterFunction<ServerResponse>
Content copied to clipboard

Allow to create easily a WebFlux.fn RouterFunction with a Reactive router Kotlin DSL.

sse
Link copied to clipboard
fun ServerResponse.BodyBuilder.sse(): ServerResponse.BodyBuilder
Content copied to clipboard

Shortcut for setting MediaType.TEXT_EVENT_STREAM `Content-Type` header.

xml
Link copied to clipboard
fun ServerResponse.BodyBuilder.xml(): ServerResponse.BodyBuilder
Content copied to clipboard

Shortcut for setting MediaType.APPLICATION_XML `Content-Type` header.