post

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

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

A class T must be annotated with io.ktor.resources.Resource.

Parameters

body

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


inline fun <T : Any, R : Any> Route.post(noinline body: suspend RoutingContext.(T, R) -> Unit): Route

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

A class T must be annotated with io.ktor.resources.Resource.

Parameters

body

receives an instance of the typed resource T as the first parameter and typed request body R as second parameter.