RouterFunctionDsl
class RouterFunctionDsl
Content copied to clipboard
Provide a WebMvc.fn RouterFunction Reactive Kotlin DSL created by router { }
in order to be able to write idiomatic Kotlin code.
Author
Sebastien Deleuze
Since
5.2
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.
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(mediaType: MediaType, f: (ServerRequest) -> 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(predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
fun DELETE(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
filter
Link copied to clipboard
fun filter(filterFunction: (ServerRequest, (ServerRequest) -> ServerResponse) -> 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) -> ServerResponse)
Content copied to clipboard
fun GET(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> 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(predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
fun HEAD(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> 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) -> ServerResponse)
Content copied to clipboard
invoke
Link copied to clipboard
operator fun RequestPredicate.invoke(f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
method
Link copied to clipboard
nest
Link copied to clipboard
noContent
Link copied to clipboard
not
Link copied to clipboard
notFound
Link copied to clipboard
ok
Link copied to clipboard
onError
Link copied to clipboard
inline fun <E : Throwable> onError(noinline responseProvider: (Throwable, ServerRequest) -> ServerResponse)
Content copied to clipboard
fun onError(predicate: (Throwable) -> Boolean, responseProvider: (Throwable, ServerRequest) -> 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(predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
fun OPTIONS(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> 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).
param
Link copied to clipboard
fun param(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 param(name: String, predicate: (String) -> Boolean, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
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(predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
fun PATCH(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
path
Link copied to clipboard
pathExtension
Link copied to clipboard
fun pathExtension(predicate: (String) -> Boolean, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
fun pathExtension(extension: String, f: (ServerRequest) -> 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(predicate: RequestPredicate, f: (ServerRequest) -> ServerResponse)
Content copied to clipboard
fun POST(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> 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) -> ServerResponse)
Content copied to clipboard
fun PUT(pattern: String, predicate: RequestPredicate, f: (ServerRequest) -> 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