respondText

suspend fun ApplicationCall.respondText(text: String, contentType: <ERROR CLASS>? = null, status: <ERROR CLASS>? = null, configure: <ERROR CLASS>.() -> Unit = {})

Responds to a client with a plain text response, using specified text

Parameters

contentType

is an optional ContentType, default is ContentType.Text.Plain

status

is an optional HttpStatusCode, default is HttpStatusCode.OK


suspend fun ApplicationCall.respondText(contentType: <ERROR CLASS>? = null, status: <ERROR CLASS>? = null, provider: suspend () -> String)

Responds to a client with a plain text response, using specified provider to build a text

Parameters

contentType

is an optional ContentType, default is ContentType.Text.Plain

status

is an optional HttpStatusCode, default is HttpStatusCode.OK