open class RouterFunctionDsl
Provide a RouterFunction Kotlin DSL in order to be able to write idiomatic Kotlin code.
Author
Sebastien Deleuze
Author
Yevhenii Melnyk
Since
5.0
| RouterFunctionDsl()Provide a RouterFunction Kotlin DSL in order to be able to write idiomatic Kotlin code. | 
| fun DELETE(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given DELETE predicate applies. fun DELETE(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code DELETE} and the given {@code pattern} matches against the request path. | |
| fun GET(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given request predicate applies. fun GET(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code GET} and the given {@code pattern} matches against the request path. | |
| fun HEAD(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given request predicate applies. fun HEAD(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code HEAD} and the given {@code pattern} matches against the request path. | |
| fun OPTIONS(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given OPTIONS predicate applies. fun OPTIONS(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code OPTIONS} and the given {@code pattern} matches against the request path. | |
| fun PATCH(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given PATCH predicate applies. fun PATCH(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code PATCH} and the given {@code pattern} matches against the request path. | |
| fun POST(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given POST predicate applies. fun POST(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code POST} and the given {@code pattern} matches against the request path. | |
| fun PUT(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given PUT predicate applies. fun PUT(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that matches if request's HTTP method is {@code PUT} and the given {@code pattern} matches against the request path. | |
| fun accept(mediaType: MediaType, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given accept predicate applies. fun accept(mediaType: MediaType): RequestPredicateReturn a {@code RequestPredicate} that tests if the request's {@linkplain ServerRequest.Headers#accept() accept} header is {@linkplain MediaType#isCompatibleWith(MediaType) compatible} with any of the given media types. | |
| infix fun RequestPredicate.and(other: String): RequestPredicateReturn a composed request predicate that tests against both this predicate AND
the other predicate (String processed as a path predicate). When evaluating the
composed predicate, if this predicate is  infix fun String.and(other: RequestPredicate): RequestPredicateReturn a composed request predicate that tests against both this predicate (String
processed as a path predicate) AND the other predicate. When evaluating the
composed predicate, if this predicate is  infix fun RequestPredicate.and(other: RequestPredicate): RequestPredicateReturn a composed request predicate that tests against both this predicate AND
the other predicate. When evaluating the composed predicate, if this
predicate is  | |
| fun contentType(mediaType: MediaType, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given contentType predicate applies. fun contentType(mediaType: MediaType): RequestPredicateReturn a {@code RequestPredicate} that tests if the request's {@linkplain ServerRequest.Headers#contentType() content type} is {@linkplain MediaType#includes(MediaType) included} by any of the given media types. | |
| fun headers(headersPredicate: (Headers) -> Boolean, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given headers predicate applies. fun headers(headersPredicate: (Headers) -> Boolean): RequestPredicateReturn a {@code RequestPredicate} that tests the request's headers against the given headers predicate. | |
| operator fun RequestPredicate.invoke(f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given request predicate applies. operator fun String.invoke(f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given predicate (String processed as a path predicate) applies. | |
| fun method(httpMethod: HttpMethod, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given method predicate applies. fun method(httpMethod: HttpMethod): RequestPredicateReturn a {@code RequestPredicate} that tests against the given HTTP method. | |
| fun RequestPredicate.nest(r: RouterFunctionDsl.() -> Unit): UnitRoute to the given router function if the given request predicate applies. This method can be used to create nested routes, where a group of routes share a common path (prefix), header, or other request predicate. fun String.nest(r: RouterFunctionDsl.() -> Unit): UnitRoute to the given router function if the given request predicate (String processed as a path predicate) applies. This method can be used to create nested routes, where a group of routes share a common path (prefix), header, or other request predicate. | |
| operator fun RequestPredicate.not(): RequestPredicateReturn a predicate that represents the logical negation of this predicate. | |
| infix fun RequestPredicate.or(other: String): RequestPredicateReturn a composed request predicate that tests against both this predicate OR
the other predicate (String processed as a path predicate). When evaluating the
composed predicate, if this predicate is  infix fun String.or(other: RequestPredicate): RequestPredicateReturn a composed request predicate that tests against both this predicate (String
processed as a path predicate) OR the other predicate. When evaluating the
composed predicate, if this predicate is  infix fun RequestPredicate.or(other: RequestPredicate): RequestPredicateReturn a composed request predicate that tests against both this predicate OR
the other predicate. When evaluating the composed predicate, if this
predicate is  | |
| fun path(pattern: String, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given path predicate applies. fun path(pattern: String): RequestPredicateReturn a {@code RequestPredicate} that tests the request path against the given path pattern. | |
| fun pathExtension(extension: String, f: (ServerRequest) -> Mono<ServerResponse>): Unitfun pathExtension(predicate: (String) -> Boolean, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given pathExtension predicate applies. fun pathExtension(extension: String): RequestPredicateReturn a {@code RequestPredicate} that matches if the request's path has the given extension. fun pathExtension(predicate: (String) -> Boolean): RequestPredicateReturn a {@code RequestPredicate} that matches if the request's path matches the given predicate. | |
| fun queryParam(name: String, predicate: (String) -> Boolean, f: (ServerRequest) -> Mono<ServerResponse>): UnitRoute to the given handler function if the given queryParam predicate applies. fun queryParam(name: String, predicate: (String) -> Boolean): RequestPredicateReturn a {@code RequestPredicate} that tests the request's query parameter of the given name against the given predicate. | |
| fun resources(path: String, location: Resource): UnitRoute requests that match the given pattern to resources relative to the given root location. fun resources(lookupFunction: (ServerRequest) -> Mono<Resource>): UnitRoute to resources using the provided lookup function. If the lookup function provides a Resource for the given request, it will be it will be exposed using a HandlerFunction that handles GET, HEAD, and OPTIONS requests. |