@radzor/http-client
Resilient HTTP client with automatic retry, exponential backoff, timeout, and request/response interceptors. Built on the native fetch API. No dependencies.
Install
View source on GitHub →Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| baseUrl | string | — | Base URL prepended to all requests (e.g. https://api.example.com). |
| timeout | number | 30000 | Request timeout in milliseconds. |
| retries | number | 3 | Maximum number of retry attempts on transient failures (5xx, network errors). |
| retryDelay | number | 1000 | Initial retry delay in milliseconds. Doubles with each attempt (exponential backoff). |
| headers | Record<string, string> | — | Default headers added to every request (e.g. Authorization, Accept). |
Base URL prepended to all requests (e.g. https://api.example.com).