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 the specified provider to build a byte array.

See also

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.

See also

Parameters

contentType

is an optional ContentType, unspecified by default

status

is an optional HttpStatusCode, default is HttpStatusCode.OK