respondSource

suspend fun ApplicationCall.respondSource(source: RawSource, contentType: ContentType? = null, status: HttpStatusCode? = null, contentLength: Long? = null)

Responds to an ApplicationCall with the content from the provided kotlinx-io Source.

Parameters

source

The binary data source of the content to be responded with.

contentType

An optional ContentType, unspecified by default

status

An optional HttpStatusCode, default is HttpStatusCode.OK

contentLength

An optional value included in the Content-Length header, also truncating content