respondBytes
suspend fun ApplicationCall.respondBytes(contentType: ContentType? = null, status: HttpStatusCode? = null, provider: suspend () -> ByteArray)(source)
Responds to a client with a raw bytes response, using the specified provider to build a byte array.
Parameters
contentType
An optional ContentType, unspecified by default
status
An optional HttpStatusCode, defaults to HttpStatusCode.OK unless already assigned
See also
suspend fun ApplicationCall.respondBytes(bytes: ByteArray, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> Unit = {})(source)
Responds to a client with a raw bytes response, using specified bytes.
Parameters
contentType
An optional ContentType, unspecified by default
status
An optional HttpStatusCode, defaults to HttpStatusCode.OK unless already assigned