Optional
authOptional
baseBase URL for all requests made by this client.
Optional
bodyAny body that you want to add to your request.
Optional
bodyA function for serializing request body parameter. By default, JSON.stringify() will be used.
Optional
cacheA string indicating how the request will interact with the browser's cache to set request's cache.
Optional
credentialsA string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
Optional
fetchFetch API implementation. You can use this option to provide a custom fetch instance.
Optional
headersAn object containing any HTTP headers that you want to pre-populate your
Headers
object with.
Optional
integrityA cryptographic hash of the resource to be fetched by request. Sets request's integrity.
Optional
keepaliveA boolean to set request's keepalive.
Optional
methodThe request method.
Optional
modeA string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
Optional
nextPlease don't use the Fetch client for Next.js applications. The next
options won't have any effect.
Install @hey-api/client-next
instead.
Optional
parseReturn the response data parsed in a specified format. By default, auto
will infer the appropriate method from the Content-Type
response header.
You can override this behavior with any of the Body methods.
Select stream
if you don't want to parse response data at all.
Optional
pathOptional
priorityOptional
queryOptional
queryA function for serializing request query parameters. By default, arrays will be exploded in form style, objects will be exploded in deepObject style, and reserved characters are percent-encoded.
This method will have no effect if the native paramsSerializer()
Axios
API function is used.
Optional
redirectA string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
Optional
referrerA string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
Optional
referrerA referrer policy to set request's referrerPolicy.
Optional
responseShould we return only data or multiple fields (data, error, response, etc.)?
Optional
responseA function transforming response data before it's returned. This is useful for post-processing data, e.g. converting ISO strings into Date objects.
Optional
responseA function validating response data. This is useful if you want to ensure the response conforms to the desired shape, so it can be safely passed to the transformers and returned to the user.
Optional
securitySecurity mechanism(s) to use for the request.
Optional
signalAn AbortSignal to set request's signal.
Optional
throwThrow an error instead of returning it in the response?
Optional
windowCan only be null. Used to disassociate request from any Window.
Auth token or a function returning auth token. The resolved value will be added to the request payload as defined by its
security
array.