OptionalBasePrefix applied to a relative Url.
OptionalBasicHTTP Basic credentials. Encoded into an Authorization: Basic ... header — the replacement
for axios's auth option. An explicit Authorization header takes precedence.
OptionalBodyRequest body. A plain object or array is JSON-encoded (with a Content-Type: application/json
default); string, URLSearchParams, FormData, Blob, ArrayBuffer, and typed arrays are
passed through to fetch untouched so it can set the right Content-Type itself.
OptionalHeadersRequest headers. Merged over any client-level defaults.
OptionalMaxMaximum redirect hops to follow. Default: 5.
With ValidateUrl off, 0 returns the 3xx response itself rather than following it. With
ValidateUrl on, SafeFetch drives redirects manually, so 0 makes a redirected
request throw once the cap is hit rather than returning the 3xx.
OptionalMethodHTTP method. Default: GET.
OptionalQueryQuery-string parameters appended to the URL.
OptionalResponseHow to interpret the response body. Default: json.
OptionalSignalCaller-supplied abort signal, honored alongside Timeout.
OptionalThrowWhen true (default), a non-2xx status throws HttpError instead of returning.
OptionalTimeoutRequest timeout in milliseconds. Default: 30000. Pass 0 to disable.
Target URL. Resolved against BaseURL when that is set and this is relative.
OptionalValidateWhen true, run the URL through the SSRF guard (and re-check every redirect hop). Default: false.
Everything HttpRequest accepts. Only
Urlis required.When used through HttpClient, each field falls back to the client's corresponding option, except
Headers, which is merged over the client's defaults key-by-key.Example