ktor-locations / io.ktor.locations / io.ktor.routing.Route / handle

handle

inline fun <reified T : Any> Route.handle(noinline body: suspend PipelineContext<Unit, ApplicationCall>.(T) -> Unit): Unit

Registers a handler body for a location defined by class T.

Class T must be annotated with Location.

fun <T : Any> Route.handle(dataClass: KClass<T>, body: suspend PipelineContext<Unit, ApplicationCall>.(T) -> Unit): Unit

Registers a handler body for a location defined by class dataClass.

Class dataClass must be annotated with Location.

Parameters

body - receives an instance of typed location dataClass as first parameter.