Optionalinit: RequestInit & {Optionalevent?: {Primarily for SvelteKit's load function
OptionalresponseType?: "text" | "json"OptionalresponseType?: "json"Optionalevent?: {Primarily for SvelteKit's load function
OptionalresponseType?: "text" | "json"
Effective fetch
Sends the request and returns the response as parsed JSON (or text).
Template: T
The expected type of the JSON response
Returns
A promise that resolves to the parsed JSON or text data
Throws
If the fetch request fails or if the JSON parsing fails