putBytes

suspend fun putBytes(resource: String, body: ByteArray? = null, 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
import com.varabyte.kobweb.browser.http.bodyOf
put(resource, body?.let { bodyOf(it) }, headers, redirect, abortController).bodyAsBytes()

Call PUT on a target resource, returning the response body as a raw array of bytes.

If a request body is provided, it is also specified as a raw array of bytes.

See also tryPutBytes, which will return null if the request fails.