Tells the Data API client to use the native fetch
API for making HTTP requests.
See HttpOptions for the other options available.
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
The default http client used by the Data API client, which is the native
fetch
API.Passing in
httpOptions: { client: 'fetch' }
is equivalent to not setting thehttpOptions
at all.Polyfilling
fetch
See https://github.com/BuilderIO/this-package-uses-fetch for info about polyfilling fetch for your environment.
Customizing
fetch
You may extend the
FetchNative
class to customize thefetch
'sRequestInit
, for example to use a custom UndiciDispatcher
to further customize the HTTP options.See the below-mentioned
examples/customize-http
directory for examples & more information about extendingFetchNative
.Examples
For advanced examples & more information, see the
examples/customize-http
directory in the astra-db-ts repositorySee
HttpOptions