Tells the Data API client to use your custom "fetcher" for making HTTP requests.
See HttpOptions for the other options available.
The custom "fetcher" to use.
Optional
maxThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
maxTimeMS
option is no longer available here; the timeouts system has been overhauled, and defaults should now be set using the timeoutDefaults
option.
Overview
Allows you to use your own custom HTTP request strategy, rather than the default
fetch
orfetch-h2
implementations.It may also be used to wrap an existing Fetcher implementation (i.e. FetchNative or FetchH2) with your own custom logic or to add extra logging/debug information.
Implementation Details
See the Fetcher classes for details on implementing your own custom fetcher, along with a checklist of things to consider.
Be wary of the potential for errors or unexpected behavior if you do not take all request information into account when making the request, or make some other mistake with the fetcher.
Example
Examples
For advanced examples & more information, see the
examples/customize-http
directory in the astra-db-ts repositorySee