asBytes

abstract fun asBytes(): ByteArray

Fetches the resource body as an array of bytes.

NOTE: Just one of asBytes() and asInputStream() may be called per ResourceResponse instance. Calling asBytes() or asInputStream() a second time on the same instance will throw an Exception.