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, 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: ContentType? = null, status: HttpStatusCode? = 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