tryOptionsBytes

suspend fun tryOptionsBytes(resource: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null): ByteArray?(source)

Deprecated

We are phasing out the *Bytes version of network requests, now that we have new versions that return `Response` objects directly.

Replace with

import com.varabyte.kobweb.browser.http.FetchDefaults
import com.varabyte.kobweb.browser.http.bodyAsBytes
tryOptions(resource, headers, redirect, abortController) { bodyAsBytes() }

Like optionsBytes, but returns null instead of throwing if the request fails or its body can't be read.

Additionally, if logOnError is set to true, any failure will be logged to the console.