get

inline suspend fun <R> HttpFetcher.get(resource: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R(source)

Deprecated

With these serialization-aware network methods, we are moving response deserialization handling to a separate `bodyAs` call. This lets us accomplish the same amount of functionality with fewer methods.

Replace with

import com.varabyte.kobweb.browser.http.get
import com.varabyte.kobweb.browser.http.FetchDefaults
import com.varabyte.kobweb.browser.http.bodyAs
import kotlinx.serialization.serializer
get(resource, headers, redirect, abortController).bodyAs(responseDeserializer)

Call GET on a target resource with R as the expected return type.

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