respondBytes
suspend fun ApplicationCall.respondBytes(contentType: ContentType? = null, status: HttpStatusCode? = 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: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> 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