Optional
clientUse the default http client for making HTTP requests (currently fetch-h2).
Leave undefined to use the default client (you don't need to specify 'default'
).
Optional
fetchThe fetch-h2 module to use for making HTTP requests.
Leave undefined to use the default module.
Optional
http1Options specific to HTTP/1.1 requests.
Optional
preferWhether to prefer HTTP/2 for requests to the Data API; if set to false
, HTTP/1.1 will be used instead.
Note that this is only available when using the Data API; the DevOps API does not support HTTP/2
Both versions are generally interchangeable, but HTTP2 is generally recommended for better performance.
Defaults to true
if never provided.
true
The options available for the DataAPIClient related to making HTTP requests using the default http client.
If loading the default client fails, and httpOptions is set, it'll throw an FailedToLoadDefaultClientError.
If loading the default client fails, and httpOptions is not set, it'll silently fall back to the native fetch API.
If you're minifying your code, you'll need to provide the fetch-h2 module manually (see DefaultHttpClientOptions.fetchH2).
See the
astra-db-ts
README for more information on different clients.https://github.com/datastax/astra-db-ts