tryPutBytes
inline suspend fun <B> HttpFetcher.tryPutBytes(resource: 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.http.tryPut
import com.varabyte.kobweb.browser.http.FetchDefaults
import com.varabyte.kobweb.browser.http.bodyAsBytes
import kotlinx.serialization.serializer
Content copied to clipboard
tryPut(resource, body, headers, redirect, abortController, bodySerializer) { bodyAsBytes() }Content copied to clipboard
A serialize-friendly version of put that accepts a serializable body but returns raw bytes instead of a serialized response.