RouterFunctionDsl
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.
Author
Sebastien Deleuze
Yevhenii Melnyk
Arjen Poutsma
Since
5.0
Functions
accept
Link copied to clipboard
Return a RequestPredicate that tests if the request's accept header is compatible with any of the given media types.
fun accept(mediaType: MediaType, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
accepted
Link copied to clipboard
add
Link copied to clipboard
after
Link copied to clipboard
fun after(responseProcessor: (ServerRequest, ServerResponse) -> ServerResponse)
Content copied to clipboard
and
Link copied to clipboard
Return a composed request predicate that tests against both this predicate (String processed as a path predicate) AND the other predicate.
Return a composed request predicate that tests against both this predicate AND the other predicate (String processed as a path predicate).
infix fun RequestPredicate.and(other: RequestPredicate): RequestPredicate
Content copied to clipboard
Return a composed request predicate that tests against both this predicate AND the other predicate.
badRequest
Link copied to clipboard
before
Link copied to clipboard
contentType
Link copied to clipboard
Return a RequestPredicate that tests if the request's content type is included by any of the given media types.
fun contentType(mediaTypes: MediaType, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
created
Link copied to clipboard
DELETE
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
DELETE
and the given pattern
matches against the request path.fun DELETE(pattern: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun DELETE(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun DELETE(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
filter
Link copied to clipboard
fun filter(filterFunction: (ServerRequest, (ServerRequest) -> Mono<ServerResponse>) -> Mono<ServerResponse>)
Content copied to clipboard
from
Link copied to clipboard
GET
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
GET
and the given pattern
matches against the request path.fun GET(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun GET(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
HEAD
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
HEAD
and the given pattern
matches against the request path.fun HEAD(pattern: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun HEAD(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun HEAD(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
headers
Link copied to clipboard
fun headers(headersPredicate: (ServerRequest.Headers) -> Boolean): RequestPredicate
Content copied to clipboard
Return a RequestPredicate that tests the request's headers against the given headers predicate.
fun headers(headersPredicate: (ServerRequest.Headers) -> Boolean, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
invoke
Link copied to clipboard
operator fun String.invoke(f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
operator fun RequestPredicate.invoke(f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
method
Link copied to clipboard
fun method(httpMethod: HttpMethod, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
nest
Link copied to clipboard
noContent
Link copied to clipboard
not
Link copied to clipboard
notFound
Link copied to clipboard
onError
Link copied to clipboard
inline fun <E : Throwable> onError(noinline responseProvider: (Throwable, ServerRequest) -> Mono<ServerResponse>)
Content copied to clipboard
fun onError(predicate: (Throwable) -> Boolean, responseProvider: (Throwable, ServerRequest) -> Mono<ServerResponse>)
Content copied to clipboard
OPTIONS
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
OPTIONS
and the given pattern
matches against the request path.fun OPTIONS(pattern: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun OPTIONS(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun OPTIONS(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
or
Link copied to clipboard
Return a composed request predicate that tests against both this predicate (String processed as a path predicate) OR the other predicate.
Return a composed request predicate that tests against both this predicate OR the other predicate (String processed as a path predicate).
PATCH
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
PATCH
and the given pattern
matches against the request path.fun PATCH(pattern: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun PATCH(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun PATCH(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
path
Link copied to clipboard
fun path(pattern: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
pathExtension
Link copied to clipboard
fun pathExtension(predicate: (String) -> Boolean, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun pathExtension(extension: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
permanentRedirect
Link copied to clipboard
POST
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
POST
and the given pattern
matches against the request path.fun POST(pattern: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun POST(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun POST(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
PUT
Link copied to clipboard
Return a RequestPredicate that matches if request's HTTP method is
PUT
and the given pattern
matches against the request path.fun PUT(predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun PUT(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
queryParam
Link copied to clipboard
fun queryParam(name: String, predicate: (String) -> Boolean): RequestPredicate
Content copied to clipboard
Return a RequestPredicate that tests the request's query parameter of the given name against the given predicate.
fun queryParam(name: String, predicate: (String) -> Boolean, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
resources
Link copied to clipboard
seeOther
Link copied to clipboard
status
Link copied to clipboard
temporaryRedirect
Link copied to clipboard
unprocessableEntity
Link copied to clipboard