respondText

suspend fun ApplicationCall.respondText(text: String, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> 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: ContentType? = null, status: HttpStatusCode? = 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