headers

fun headers(headersPredicate: (ServerRequest.Headers) -> Boolean, f: (ServerRequest) -> ServerResponse)

Route to the given handler function if the given headers predicate applies.

See also

fun headers(headersPredicate: (ServerRequest.Headers) -> Boolean): RequestPredicate

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

Return

a predicate that tests against the given header predicate

Parameters

headersPredicate

a predicate that tests against the request headers