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.

See also

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 the specified provider to build a text.

See also

Parameters

contentType

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

status

is an optional HttpStatusCode, default is HttpStatusCode.OK