RequestPredicates

Implementations of RequestPredicate that implement various useful request matching operations, such as matching based on path, HTTP method, etc.

Inspired by Spring org.springframework.web.servlet.function.RequestPredicates.

Functions

Link copied to clipboard

Return a RequestPredicate that always matches.

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.

Link copied to clipboard
fun GET(pattern: String): RequestPredicate

Return a RequestPredicate that matches if request's HTTP method is GET and the given pattern matches against the request path.

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.

Link copied to clipboard
fun headers(headersPredicate: (RequestHeaders) -> Boolean): RequestPredicate

Return a RequestPredicate that tests the request's headers against the given headers predicate.

Link copied to clipboard

Return a RequestPredicate that matches if the request's HTTP method is equal to the given method.

Link copied to clipboard
fun methods(vararg methods: Method): RequestPredicate

Return a RequestPredicate that matches if the request's HTTP method is equal to the given methods.

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.

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.

Link copied to clipboard

Return a RequestPredicate that tests the request path against the given path pattern. TODO support path pattern

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.

Link copied to clipboard
fun PUT(pattern: String): RequestPredicate

Return a RequestPredicate that matches if request's HTTP method is PUT and the given pattern matches against the request path.