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

Types

Link copied to clipboard
class CoRouterFunctionDsl

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

Link copied to clipboard
class RouterFunctionDsl

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

Functions

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

Nullable variant of ServerRequest.attribute

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

Non-nullable Coroutines variant of ServerRequest.bodyToMono.

suspend fun <T : Any> ServerRequest.awaitBody(clazz: KClass<T>): T

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

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

Nullable Coroutines variant of ServerRequest.bodyToMono.

suspend fun <T : Any> ServerRequest.awaitBodyOrNull(clazz: KClass<T>): T?

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

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

Coroutines variant of ServerRequest.formData.

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

Coroutines variant of ServerRequest.multipartData.

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

Coroutines variant of ServerRequest.principal.

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

Coroutines variant of ServerRequest.session.

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

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>

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.

Link copied to clipboard
inline suspend fun <T : Any> ServerResponse.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.

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

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

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

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.

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

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.

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

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.

Link copied to clipboard
suspend fun ServerResponse.BodyBuilder.bodyValueAndAwait(body: Any): ServerResponse
Link copied to clipboard
suspend fun RenderingResponse.Builder.buildAndAwait(): RenderingResponse

Coroutines variant of RenderingResponse.Builder.build.

Link copied to clipboard
fun ServerRequest.Headers.contentLengthOrNull(): Long?
Link copied to clipboard
fun ServerRequest.Headers.contentTypeOrNull(): MediaType?
Link copied to clipboard
fun coRouter(routes: CoRouterFunctionDsl.() -> Unit): RouterFunction<ServerResponse>

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

Link copied to clipboard

Shortcut for setting MediaType.TEXT_HTMLContent-Type header.

Link copied to clipboard

Shortcut for setting MediaType.APPLICATION_JSONContent-Type header.

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

Equivalent to RouterFunction.and.

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

Nullable variant of ServerRequest.queryParam

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

Nullable variant of ServerRequest.remoteAddress

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

Coroutines variant of ServerResponse.BodyBuilder.render.

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

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

Link copied to clipboard

Shortcut for setting MediaType.TEXT_EVENT_STREAMContent-Type header.

Link copied to clipboard

Shortcut for setting MediaType.APPLICATION_XMLContent-Type header.