downloadBytes

suspend fun KiteDoc.downloadBytes(url: String, client: HttpClient, configure: HttpRequestBuilder.() -> Unit = {}): ByteArray

Downloads url and returns the raw bytes, without opening anything.

For the cases where you want the bytes themselves: writing a cache file, hashing, handing them to KiteDoc.formatOf before deciding what to do.

Throws

when the server answers with a non-2xx status.


suspend fun KiteDoc.downloadBytes(url: String, client: HttpClient, maxBytes: Int, configure: HttpRequestBuilder.() -> Unit = {}): ByteArray

downloadBytes with an explicit response-body maxBytes ceiling.