bytes

fun Body.Companion.bytes(bytes: ByteArray, contentType: String = "application/octet-stream"): Body(source)


suspend fun ContentSource.bytes(limit: Int? = null): ByteArray(source)

Convenience method to convert a body's content into a raw byte array.

Parameters

limit

If set and the size of the body is larger than it, throw an exception.