handle

inline fun <T : Any> Route.handle(noinline body: suspend RoutingContext.(T) -> Unit)(source)

Registers a handler body for a resource defined by the T class.

Report a problem

Parameters

body

receives an instance of the typed resource T as the first parameter.


fun <T : Any> Route.handle(serializer: KSerializer<T>, body: suspend RoutingContext.(T) -> Unit)(source)

Registers a handler body for a resource defined by the T class.

Report a problem

Parameters

serializer

is used to decode the parameters of the request to an instance of the typed resource T.

body

receives an instance of the typed resource T as the first parameter.