可选adapter
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]
可选allowAbsoluteUrls
allowAbsoluteUrls?: boolean
可选allowedSocketPaths
allowedSocketPaths?: string | string[] | null
可选baseURL
baseURL?: string
可选beforeRedirect
beforeRedirect?: ( options: Record<string, any>, responseDetails: { headers: Record<string, string>; statusCode: HttpStatusCode; }, requestDetails: { headers: Record<string, string>; method: string; url: string; },) => void
可选data
可选decompress
decompress?: boolean
可选env
env?: {
fetch?: (
input: string | URL | Request,
init?: RequestInit,
) => Promise<Response>;
FormData?: new (...args: any[]) => object;
Request?: new (
input: string | URL | Request,
init?: RequestInit,
) => Request;
Response?: new (
body?:
| string
| Blob
| ArrayBuffer
| FormData
| URLSearchParams
| ArrayBufferView<ArrayBufferLike>
| null,
init?: ResponseInit,
) => Response;
}
可选fetchOptions
fetchOptions?:
| Record<string, any>
| Omit<RequestInit, "headers" | "method" | "signal" | "body">
formDataHeaderPolicy?: "legacy" | "content-only"
可选http2Options
http2Options?: Record<string, any> & { sessionTimeout?: number }
可选httpAgent
httpAgent?: any
可选httpsAgent
httpsAgent?: any
可选httpVersion
httpVersion?: 2 | 1
可选insecureHTTPParser
insecureHTTPParser?: boolean
可选lookup
lookup?: | (
( hostname: string, options: object, cb: ( err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily, ) => void, ) => void )
| (
( hostname: string, options: object, ) => Promise< | LookupAddress | [ address
: LookupAddressEntry | LookupAddressEntry[], family
?: AddressFamily, ], > )
可选maxBodyLength
maxBodyLength?: number
可选maxContentLength
maxContentLength?: number
可选maxRate
maxRate?: number | [number, number]
可选maxRedirects
maxRedirects?: number
可选method
method?: StringLiteralsOrString<Method>
可选params
可选parseReviver
parseReviver?: (
this: any,
key: string,
value: any,
context?: { source?: string },
) => any
可选redact
redact?: string[]
sensitiveHeaders?: string[]
可选socketPath
socketPath?: string | null
可选timeout
timeout?: number
可选timeoutErrorMessage
timeoutErrorMessage?: string
可选transport
transport?: any
可选validateStatus
validateStatus?: ((status: number) => boolean) | null
可选withCredentials
withCredentials?: boolean
可选withXSRFToken
可选xsrfCookieName
xsrfCookieName?: string