About axios/axios
axios/axios is an open-source project on GitHub, mainly written in JavaScript. Promise based HTTP client for the browser and node.js It currently holds 109,393 stars and 12,021 forks with 121 open issues, and was last pushed on 2026-11-11 (repository created 2014-08-18).
Project Overview
Git Homed tracks it on the Today's Trending board, currently at rank #79 with 74 new stars today.
GitHub Repository Details
README
[!IMPORTANT]
Get Security Updates for Axios v0 & Early Access Provider →
💎 Platinum sponsors
We're passionate about making open source sustainable. Scan your dependency tree to better understand which open source projects need funding. |
💜 Become a sponsor |
| 💜 Become a sponsor | 💜 Become a sponsor |
🥇 Gold sponsors
Promise based HTTP client for the browser and node.js
Table of contents
- Features
- Browser support
- Installing
- Package manager
- CDN
- Example
- Axios API
- Request method aliases
- Concurrency
- Creating an instance
- Instance methods
- Request config
- Response schema
- Config defaults
- Global axios defaults
- Custom instance defaults
- Config order of precedence
- Interceptors
- Multiple interceptors
- Handling errors
- Handling timeouts
- Cancellation
- AbortController
- CancelToken
- Using application/x-www-form-urlencoded format
- URLSearchParams
- Query string
- Automatic serialization
- Using multipart/form-data format
- FormData
- Automatic serialization
- Posting files
- HTML form posting
- Progress capturing
- Rate limiting
- AxiosHeaders
- Fetch adapter
- Custom fetch
- Using with Tauri
- Using with SvelteKit
- HTTP/2 support
- Semver
- Promises
- TypeScript
- Contributing
- Local setup
- Resources
- Credits
- License
Features
- Make XMLHttpRequests from the browser.
- Make http requests from Node.js.
- Use the Promise API for asynchronous request handling.
- Intercept requests and responses to add custom logic or transform data.
- Transform request and response data.
- Cancel requests with built-in cancellation APIs.
- Serialize and parse JSON data.
- Serialize data objects to
multipart/form-dataorapplication/x-www-form-urlencoded. - Add client-side protection against Cross-Site Request Forgery.
Browser support
| Chrome | Firefox | Safari | Opera | Edge |
| :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: |
|
|
|
|
|
|
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
Installing
Package manager
Using npm:
$ npm install axios
Using yarn:
$ yarn add axios
Using pnpm:
$ pnpm add axios
Using bun:
$ bun add axios
Using Deno:
$ deno add axios
Once the package is installed, import it with import or require:
import axios, { isCancel, AxiosError } from 'axios';
You can also use the default export, since the named export is just a re-export from the Axios factory:
import axios from 'axios';
console.log(axios.isCancel('something'));
If you use require for importing, only the default export is available:
const axios = require('axios');
console.log(axios.isCancel('something'));
Some bundlers and ES6 linters need this form:
import { default as axios } from 'axios';
In custom or legacy environments, you can import the bundle directly:
const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017)
// const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017)
CDN
Using jsDelivr CDN (ES5 UMD browser module):
Using unpkg CDN:
Example
```js import axios from 'axios'; //const axios = require('axios'); // legacy way
try { const response = await axios.get('/user?ID=12345'); console.log(re