Fetches url as text, retrying on network errors, 429, and 5xx responses with
exponential backoff (respecting a Retry-After header when present), and enforcing a
maximum response size. A thin convenience wrapper around fetchWithRetryRaw for the
common GET-and-read-as-text case; use fetchWithRetryRaw directly for other methods,
request bodies, or response handling.
The size cap is checked against the Content-Length header first, before reading the body,
to reject an oversized response without buffering it into memory. Content-Length is
optional, though (e.g. chunked transfer-encoding omits it), so the body's actual length is
still checked afterward as a fallback for responses that didn't send an (accurate) header.
Fetches
urlas text, retrying on network errors,429, and5xxresponses with exponential backoff (respecting aRetry-Afterheader when present), and enforcing a maximum response size. A thin convenience wrapper around fetchWithRetryRaw for the common GET-and-read-as-text case; use fetchWithRetryRaw directly for other methods, request bodies, or response handling.The size cap is checked against the
Content-Lengthheader first, before reading the body, to reject an oversized response without buffering it into memory.Content-Lengthis optional, though (e.g. chunked transfer-encoding omits it), so the body's actual length is still checked afterward as a fallback for responses that didn't send an (accurate) header.