handle

inline fun <Req, Res, ReqH, ResH, PathP, QueryP, CookieP> ApiContract<Req, Res, ReqH, ResH, PathP, QueryP, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Res, ReqH, ResH, PathP, QueryP, CookieP>.(Req, PathP, QueryP) -> ApiResponse<Res, ResH>)

Adds an ApiContract to the server by registering a route with the given handler.

Context parameters in the handler can be accessed via contextOf.

Parameters

handler

The function to handle the request.


@JvmName(name = "handleUnit")
inline fun <Req, ReqH, PathP, QueryP, CookieP> ApiContract<Req, Unit, ReqH, Empty, PathP, QueryP, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Unit, ReqH, Empty, PathP, QueryP, CookieP>.(Req, PathP, QueryP) -> Unit)

Adds an ApiContract, with no response body or headers, to the server by registering a route with the given handler.

Context parameters in the handler can be accessed via contextOf.

Parameters

handler

The function to handle the request.


inline fun <Req, Res, ReqH, ResH, CookieP> ApiContract<Req, Res, ReqH, ResH, Empty, Empty, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Res, ReqH, ResH, Empty, Empty, CookieP>.(Req) -> ApiResponse<Res, ResH>)

Adds an ApiContract, with no query or path parameters, to the server by registering a route with the given handler.

Context parameters in the handler can be accessed via contextOf.

Parameters

handler

The function to handle the request.


@JvmName(name = "handleSimpleUnit")
inline fun <Req, ReqH, CookieP> ApiContract<Req, Unit, ReqH, Empty, Empty, Empty, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Unit, ReqH, Empty, Empty, Empty, CookieP>.(Req) -> Unit)

Adds an ApiContract, with no response body, response headers, query parameters or path parameters, to the server by registering a route with the given handler.

Context parameters in the handler can be accessed via contextOf.

Parameters

handler

The function to handle the request.