api

http4k / org.http4k.contract / ContractRoutingHttpHandler

ContractRoutingHttpHandler

data class ContractRoutingHttpHandler : RoutingHttpHandler

Constructors

Name Summary
<init> ContractRoutingHttpHandler(renderer: ContractRenderer, security: Security?, descriptionSecurity: Security?, descriptionPath: String, preFlightExtraction: PreFlightExtraction, routes: List<ContractRoute> = emptyList(), rootAsString: String = "", preSecurityFilter: Filter = Filter.NoOp, postSecurityFilter: Filter = Filter.NoOp, includeDescriptionRoute: Boolean = false)

Functions

Name Summary
invoke fun invoke(request: Request): Response
match Attempt to supply an HttpHandler which can service the passed request.fun match(request: Request): RouterMatch
toString fun toString(): String
withBasePath Returns a Router which prepends the passed base path to the logic determining the match().fun withBasePath(new: String): ContractRoutingHttpHandler
withFilter NOTE: By default, filters for Contracts are applied before the Security filter. Use withPostSecurityFilter() to achieve population of filters after security.fun withFilter(new: Filter): ContractRoutingHttpHandler
withPostSecurityFilter fun withPostSecurityFilter(new: Filter): ContractRoutingHttpHandler

Extension Functions

Name Summary
and infix fun Router.and(that: Router): Router
bind infix fun Router.bind(handler: HttpHandler): RoutingHttpHandler
infix fun Router.bind(handler: RoutingHttpHandler): RoutingHttpHandler