Reference

Instance API

The axios instance: request methods, defaults, interceptors and the request pipeline.

axios.create(config) returns an instance with the same request helpers as the default export, plus a merged defaults object and its own interceptor registry.

const api = axios.create({ baseURL: "https://api.example.com", timeout: 5000 });

Instance methods

MethodKind
getUri(config)method
request(config: AxiosRequestConfig<D, P>)method
get(url: string, config?: AxiosRequestConfig<D, P>)method
delete(url: string, config?: AxiosRequestConfig<D, P>)method
head(url: string, config?: AxiosRequestConfig<D, P>)method
options(url: string, config?: AxiosRequestConfig<D, P>)method
post(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method
put(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method
patch(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method
postForm(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method
putForm(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method
patchForm(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method
query(url: string, data?: D, config?: AxiosRequestConfig<D, P>)method

HTTP verbs generated by the core

lib/core/Axios.js builds the verb helpers from the shared method list:

get, delete, head, options, post, put, patch, purge, link, unlink, query

Static surface of the default export

AxiosStatic (from index.d.ts) declares everything reachable on the default axios object:

MemberKind
Cancelproperty
CancelTokenproperty
Axiosproperty
AxiosErrorproperty
HttpStatusCodeproperty
VERSIONproperty
isCancelproperty
allproperty
spreadproperty
isAxiosErrorproperty
toFormDataproperty
formToJSONproperty
getAdapterproperty
CanceledErrorproperty
AxiosHeadersproperty
mergeConfigproperty

Instance properties

PropertyTypeDescription
defaultsAxiosDefaultsThe merged defaults for this instance; mutating it changes later requests.
interceptorsInterceptorManagerRequest/response interceptor registries (see interceptors).

Merge rules

Instance defaults and per-request config are merged with mergeConfig. Keys defined per request win; headers, params and auth are merged rather than replaced. See request config for every key.

Source

Parsed from lib/core/Axios.js and the Axios / AxiosStatic interfaces in index.d.ts at commit e6b79d9cef79.