Extensions for io.ktor.routing.Route

delete

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

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

get

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

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

handle

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

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

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.

head

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

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

location

fun <T : Any> Route.location(body: Route.() -> Unit): Route

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

fun <T : Any> Route.location(
    data: KClass<T>,
    body: Route.() -> Unit
): Route

Registers a route body for a location defined by class data.

options

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

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

patch

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

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

post

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

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

put

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

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