spring-framework / org.springframework.web.reactive.function.server / CoRouterFunctionDsl / headers

headers

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

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

See Also

RouterFunctions.route

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

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

Parameters

headersPredicate - a predicate that tests against the request headers

Return
a predicate that tests against the given header predicate