OptionaldefaultOptionalmaxRedirects (301/302/303/307/308) followed per request, same host only. Defaults to 3; 0 disables; at most MAX_REDIRECTS. Any other 3xx, one without a Location, and one past this limit surface as an OparlApiError naming the target.
OptionalmaxHard cap on response body size in bytes (defends against memory exhaustion from a hostile/buggy endpoint). Defaults to 100 MiB; set to 0 for no limit. A non-negative integer.
OptionalmaxNumber of automatic retries for transient 429/503 responses and reset connections (ECONNRESET, EPIPE, ECONNABORTED, UND_ERR_SOCKET): 0 to MAX_RETRIES. Timeouts are not retried.
OptionalonCalled once per retry, right before the backoff sleep, for each retried 429/503 and reset connection; never when there is no retry. A throw is swallowed.
OptionalretryBase backoff between retries in milliseconds (default 500), 0 to MAX_RETRY_AFTER_MS (30 000). Grows linearly per attempt for a 503 and a reset; a 429 waits at least 1 s, doubling per attempt. A Retry-After header (seconds or an HTTP date) can lengthen a wait, never shorten it; every wait is capped at 30 s.
OptionalsleepInjectable sleep, primarily for deterministic tests.
OptionaltimeoutTime limit per request in milliseconds, covering the whole response body, not only idle gaps (0 disables). Defaults to 120 s: some council systems take well over 30 s to render a single list page. A non-negative integer, capped at MAX_TIMEOUT_MS. The engine enforces it for every transport.
OptionaltransportSwappable transport. Defaults to the built-in node http/https transport. The engine
enforces timeoutMs and maxResponseBytes on any transport and checks the shape of
what it returns (see HttpResponse).
OptionaluserValue of the User-Agent header.
Extra headers sent on every request. The values of credential headers (Authorization, Proxy-Authorization, X-API-Key, Cookie) are kept out of logged clients and errors, and go only to the origin of the URL a request starts at (see fetchJson).