respondBytes

suspend fun ApplicationCall.respondBytes(contentType: <ERROR CLASS>? = null, status: <ERROR CLASS>? = null, provider: suspend () -> ByteArray)

Responds to a client with a raw bytes response, using specified provider to build a byte array

Parameters

contentType

is an optional ContentType, unspecified by default

status

is an optional HttpStatusCode, default is HttpStatusCode.OK


suspend fun ApplicationCall.respondBytes(bytes: ByteArray, contentType: <ERROR CLASS>? = null, status: <ERROR CLASS>? = null, configure: <ERROR CLASS>.() -> Unit = {})

Responds to a client with a raw bytes response, using specified bytes

Parameters

contentType

is an optional ContentType, unspecified by default

status

is an optional HttpStatusCode, default is HttpStatusCode.OK