patchBytes
inline suspend fun <B> ApiFetcher.patchBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): 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.patch
import com.varabyte.kobweb.browser.http.FetchDefaults
import com.varabyte.kobweb.browser.http.bodyAsBytes
import kotlinx.serialization.serializer
Content copied to clipboard
patch(apiPath, body, headers, redirect, abortController, bodySerializer).bodyAsBytes()Content copied to clipboard
A serialize-friendly version of patch that accepts a serializable body and returns its response as a raw byte array.
Note: you should NOT prepend your path with "api/", as that will be added automatically.