Package io.ktor.server.resources

Types

Link copied to clipboard
object Resources

Adds support for type-safe routing using ResourcesCore.

Functions

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.delete(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.get(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.handle(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit)
fun <T : Any> <ERROR CLASS>.handle(serializer: <ERROR CLASS><T>, body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit)

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.head(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.href(resource: T): String
inline fun <T : Any> <ERROR CLASS>.href(resource: T, urlBuilder: <ERROR CLASS>)

Constructs a URL for resource.

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.options(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.patch(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.post(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.put(noinline body: suspend <ERROR CLASS><Unit, <ERROR CLASS>>.(T) -> Unit): <ERROR CLASS>

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

Link copied to clipboard
inline fun <T : Any> <ERROR CLASS>.resource(noinline body: <ERROR CLASS>.() -> Unit): <ERROR CLASS>
fun <T : Any> <ERROR CLASS>.resource(serializer: <ERROR CLASS><T>, body: <ERROR CLASS>.() -> Unit): <ERROR CLASS>

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