Package-level declarations

Functions

Link copied to clipboard
inline suspend fun <T : Any> Request.body(): T

Deserializes and returns this body as an instance of type T.

Link copied to clipboard
fun Headers.jsonContentType()

Appends json content-type to this instance.

Link copied to clipboard
inline fun <T : Any> jsonResponse(body: T, init: ResponseInit = ResponseInit( status = 200, statusText = "OK", headers = Headers().apply { jsonContentType() } )): Response

Creates a Response with json content-type header and body as body. The response status (200 by default) and headers can be changed by supplying init.