Type Alias: FetchCustomOptions
FetchCustomOptions =
object&FetchRetryOptions&TimeoutOptions<[]>
Defined in: packages/fetch/src/types/options.ts:45
Custom fetch options (not used by built-in fetch()
Type Declaration
abortCtrl?
optionalabortCtrl:AbortController
An AbortController instance to control the request.
If not provided, a new instance is automatically created internally.
It is supported in addition to the standard signal. If both are provided, abortCtrl will be aborted when the signal aborts or when the request times out.
Recommendation:
- For request timeout purposes, setting a timeout duration will be sufficient. Abort controller/signal is not needed.
- Use
abortCtrlinstead ofsignalto prevent creating internalAbortControllerinstance.
as?
optionalas:FetchAs
Specify how the parse the result. To get raw response use FetchAs.response. Default: 'json'
body?
optionalbody:PostArgs[1]
errMsgs?
optionalerrMsgs:FetchErrMsgs
fetchFunc?
optionalfetchFunc:FetchFunc
Custom fetch function to use instead of the global fetch. Useful for testing or using a different fetch implementation (e.g. node-fetch in older Node versions).
Default: globalThis.fetch
interceptors?
optionalinterceptors:FetchInterceptors
Interceptor/transformer callback executed at different stages of the request. See FetchInterceptors for more details.
validateUrl?
optionalvalidateUrl:boolean
Whether to validate URL before making the request. Default: false