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 RoutingHttpHandler which prepends the passed base path to the logic determining the match() To follow the trend of immutability, this will generally be a new instance.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