respondText

suspend fun ApplicationCall.respondText(text: String, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> Unit = {})(source)

Responds to a client with a plain text response.

Report a problem

Parameters

contentType

An optional ContentType, defaults to ContentType.Text.Plain

status

An optional HttpStatusCode, defaults to HttpStatusCode.OK unless already assigned

See also


suspend fun ApplicationCall.respondText(contentType: ContentType? = null, status: HttpStatusCode? = null, provider: suspend () -> String)(source)

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

Report a problem

Parameters

contentType

An optional ContentType, defaults to ContentType.Text.Plain

status

An optional HttpStatusCode, defaults to HttpStatusCode.OK unless already assigned

See also