fetchJson
Fetches a URL and returns its parsed JSON body, retrying transient failures (network errors,
5xx and 429).
Available since v3.1.5
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input | RequestInfo | URL | URL or `Request` object passed to `fetch` |
init | RequestInit | Optional `RequestInit` options passed to `fetch` (optional) |
options | FetchJsonOptions | Retry configuration — see FetchJsonOptions |
Returns
Section titled “Returns”Promise<T> — The parsed JSON body
Examples
Section titled “Examples”fetchJson
Section titled “fetchJson”Related Types
Section titled “Related Types”FetchJsonOptions
Section titled “FetchJsonOptions”Options for fetchJson.
