[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-172":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":8,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":8,"pushedAt":8,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":18,"lastSyncTime":31,"discoverSource":32},172,"axios","axios\u002Faxios","Promise based HTTP client for the browser and node.js",null,"https:\u002F\u002Fgithub.com\u002Faxios\u002Faxios","JavaScript",109076,11710,1158,114,0,10,63,2,78.3,false,"main",[23,24,25,26,27],"http-client","javascript","nodejs","promise","hacktoberfest","2026-06-17 04:00:02","\u003Ch3 align=\"center\">💎 Platinum sponsors \u003Cbr \u002F>\u003C\u002Fh3>\n\u003Ctable align=\"center\">\n    \u003Ctr>\n        \u003Ctd align=\"center\" width=\"50%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fthanks.dev\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Fthanks-dev\u002F360b917\u002Flogo\u002F256.png?height=256\"\n                    alt=\"Thanks.dev\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n            >\n                We're passionate about making open source sustainable. Scan your dependency tree to better understand which open source projects need funding.\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Fthanks.dev\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                    target=\"_blank\"\n                    >\u003Cb>thanks.dev\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"50%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fhopper.security\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Fhopper-security\u002Fc4f7de2\u002Favatar.png\"\n                    alt=\"Hopper Security\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp align=\"center\">\n                Hopper provides a secure, open-source registry where every component is verified against malware and continuously remediated for vulnerabilities across all versions. In simple terms, Hopper removes the need to manage software supply chain risk altogether.\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Fhopper.security\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                    target=\"_blank\"\n                    >\u003Cb>hopper.security\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003Ctable align=\"center\">\n    \u003Ctr>\n        \u003Ctd align=\"center\" width=\"50%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fopencollective.com\u002Faxios\u002Fcontribute\"\n                target=\"_blank\"\n                >💜 Become a sponsor\u003C\u002Fa\n            >\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"50%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fopencollective.com\u002Faxios\u002Fcontribute\"\n                target=\"_blank\"\n                >💜 Become a sponsor\u003C\u002Fa\n            >\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003Ch3 align=\"center\">🥇 Gold sponsors \u003Cbr \u002F>\u003C\u002Fh3>\n\u003Ctable align=\"center\" width=\"100%\">\n    \u003Ctr width=\"33.333333333333336%\">\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fwww.principal.com\u002Fabout-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Fprincipal\u002F431e690\u002Flogo.png\"\n                    alt=\"Principal Financial Group\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n            >\n                Free tools to help with your financial planning needs!\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Fwww.principal.com\u002Fabout-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                    target=\"_blank\"\n                    >\u003Cb>principal.com\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fopensource.sap.com?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2531208?s=200&v=4\"\n                    alt=\"SAP\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n                title=\"SAP SE, a global software company, is one of the largest vendors of ERP and other enterprise applications.\"\n            >\n                BSAP SE, a global software company, is one of the largest vendors of ERP and other enterprise applications.\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Fopensource.sap.com?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                    target=\"_blank\"\n                    >\u003Cb>opensource.sap.com\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fwww.descope.com\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n               \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Fdescope\u002Fb53243e\u002Flogo.png\"\n                    alt=\"Descope\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n                title=\"Hi, we&#x27;re Descope! We are building something in the authentication space for app developers and can’t wait to place it in your hands.\"\n            >\n                Reduce user friction, prevent account takeover, and get a 360° view of your customer and agentic identities with the Descope External IAM platform.\n            \u003C\u002Fp>\n              \u003Cp align=\"center\">\n                   \u003Ca\n                       href=\"https:\u002F\u002Fwww.descope.com\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship\"\n                       target=\"_blank\"\n                       >\u003Cb>descope.com\u003C\u002Fb>\u003C\u002Fa\n                   >\n              \u003C\u002Fp>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr width=\"33.333333333333336%\">\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fstytch.com\u002F\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n               \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Fstytch\u002Ff84ce43\u002Flogo\u002F256.png?height=256\"\n                    alt=\"Stytch\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n            >\n                The identity platform for humans & AI agents\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                   \u003Ca\n                       href=\"https:\u002F\u002Fstytch.com\"\n                       target=\"_blank\"\n                       >\u003Cb>stytch.com\u003C\u002Fb>\u003C\u002Fa\n                   >\n              \u003C\u002Fp>\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Frxdb.info\u002F?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship&utm_content=logo\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"90px\"\n                    height=\"90px\"\n                    src=\"https:\u002F\u002Frxdb.info\u002Ffiles\u002Flogo\u002Flogo_text_white.svg\"\n                    alt=\"RxDB\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n            >\n                RxDB is a NoSQL database for JavaScript that runs directly in your app.\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Frxdb.info\u002F?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship&utm_content=logo\"\n                    target=\"_blank\"\n                    >\u003Cb>rxdb.info\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fpoprey.com\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"70px\"\n                    height=\"70px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Finstagram-likes\u002F2a72a03\u002Favatar.png\"\n                    alt=\"Poprey\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp align=\"center\">\n                Buy Instagram Likes\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Fpoprey.com\u002F?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship\"\n                    target=\"_blank\"\n                    >\u003Cb>poprey.com\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr width=\"33.333333333333336%\">\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fbuzzoid.com\u002Fbuy-instagram-followers\u002F?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship\"\n                style=\"padding: 10px; display: inline-block\"\n                target=\"_blank\"\n            >\n                \u003Cimg\n                    width=\"71px\"\n                    height=\"70px\"\n                    src=\"https:\u002F\u002Fimages.opencollective.com\u002Fbuzzoid-buy-instagram-followers\u002F56a09fe\u002Flogo.png\"\n                    alt=\"Buzzoid - Buy Instagram Followers\"\n                \u002F>\n            \u003C\u002Fa>\n            \u003Cp\n                align=\"center\"\n            >\n                At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world&#39;s #1 IG service since 2012.\n            \u003C\u002Fp>\n            \u003Cp align=\"center\">\n                \u003Ca\n                    href=\"https:\u002F\u002Fbuzzoid.com\u002Fbuy-instagram-followers\u002F?utm_source=axios_docs_website&utm_medium=website&utm_campaign=axios_open_collective_sponsorship\"\n                    target=\"_blank\"\n                    >\u003Cb>buzzoid.com\u003C\u002Fb>\u003C\u002Fa\n                >\n            \u003C\u002Fp>\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fopencollective.com\u002Faxios\u002Fcontribute\"\n                target=\"_blank\"\n                >💜 Become a sponsor\u003C\u002Fa\n            >\n        \u003C\u002Ftd>\n        \u003Ctd align=\"center\" width=\"33.333333333333336%\">\n            \u003Ca\n                href=\"https:\u002F\u002Fopencollective.com\u002Faxios\u002Fcontribute\"\n                target=\"_blank\"\n                >💜 Become a sponsor\u003C\u002Fa\n            >\n        \u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\n\u003C!--\u003Cdiv>marker\u003C\u002Fdiv>-->\n\n\u003Cbr>\u003Cbr>\n\n\u003Cdiv align=\"center\">\n   \u003Ca href=\"https:\u002F\u002Faxios.rest\">\u003Cimg src=\"https:\u002F\u002Faxios.rest\u002Flogo.svg\" alt=\"Axios\" \u002F>\u003C\u002Fa>\u003Cbr>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">Promise based HTTP client for the browser and node.js\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Faxios.rest\u002F\">\u003Cb>Website\u003C\u002Fb>\u003C\u002Fa> •\n    \u003Ca href=\"https:\u002F\u002Faxios.rest\u002Fpages\u002Fgetting-started\u002Ffirst-steps.html\">\u003Cb>Documentation\u003C\u002Fb>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cdiv align=\"center\">\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Faxios.svg?style=flat-square)](https:\u002F\u002Fwww.npmjs.org\u002Fpackage\u002Faxios)\n[![CDNJS](https:\u002F\u002Fimg.shields.io\u002Fcdnjs\u002Fv\u002Faxios.svg?style=flat-square)](https:\u002F\u002Fcdnjs.com\u002Flibraries\u002Faxios)\n[![Build status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Faxios\u002Faxios\u002Fci.yml?branch=v1.x&label=CI&logo=github&style=flat-square)](https:\u002F\u002Fgithub.com\u002Faxios\u002Faxios\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Gitpod Ready-to-Code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGitpod-Ready--to--Code-blue?logo=gitpod&style=flat-square)](https:\u002F\u002Fgitpod.io\u002F#https:\u002F\u002Fgithub.com\u002Faxios\u002Faxios)\n[![code coverage](https:\u002F\u002Fimg.shields.io\u002Fcoveralls\u002Fmzabriskie\u002Faxios.svg?style=flat-square)](https:\u002F\u002Fcoveralls.io\u002Fr\u002Fmzabriskie\u002Faxios)\n[![install size](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fjson?url=https:\u002F\u002Fpackagephobia.com\u002Fv2\u002Fapi.json?p=axios&query=$.install.pretty&label=install%20size&style=flat-square)](https:\u002F\u002Fpackagephobia.now.sh\u002Fresult?p=axios)\n[![npm bundle size](https:\u002F\u002Fimg.shields.io\u002Fbundlephobia\u002Fminzip\u002Faxios?style=flat-square)](https:\u002F\u002Fbundlephobia.com\u002Fpackage\u002Faxios@latest)\n[![npm downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Faxios.svg?style=flat-square)](https:\u002F\u002Fnpm-stat.com\u002Fcharts.html?package=axios)\n[![gitter chat](https:\u002F\u002Fimg.shields.io\u002Fgitter\u002Froom\u002Fmzabriskie\u002Faxios.svg?style=flat-square)](https:\u002F\u002Fgitter.im\u002Fmzabriskie\u002Faxios)\n[![code helpers](https:\u002F\u002Fwww.codetriage.com\u002Faxios\u002Faxios\u002Fbadges\u002Fusers.svg)](https:\u002F\u002Fwww.codetriage.com\u002Faxios\u002Faxios)\n[![Contributors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fcontributors\u002Faxios\u002Faxios.svg?style=flat-square)](CONTRIBUTORS.md)\n\n\u003C\u002Fdiv>\n\n## Table of Contents\n\n- [Features](#features)\n- [Browser Support](#browser-support)\n- [Installing](#installing)\n  - [Package manager](#package-manager)\n  - [CDN](#cdn)\n- [Example](#example)\n- [Axios API](#axios-api)\n- [Request method aliases](#request-method-aliases)\n- [Concurrency 👎](#concurrency-deprecated)\n- [Creating an instance](#creating-an-instance)\n- [Instance methods](#instance-methods)\n- [Request Config](#request-config)\n- [Response Schema](#response-schema)\n- [Config Defaults](#config-defaults)\n  - [Global axios defaults](#global-axios-defaults)\n  - [Custom instance defaults](#custom-instance-defaults)\n  - [Config order of precedence](#config-order-of-precedence)\n- [Interceptors](#interceptors)\n  - [Multiple Interceptors](#multiple-interceptors)\n- [Handling Errors](#handling-errors)\n- [Handling Timeouts](#handling-timeouts)\n- [Cancellation](#cancellation)\n  - [AbortController](#abortcontroller)\n  - [CancelToken 👎](#canceltoken-deprecated)\n- [Using application\u002Fx-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format)\n  - [URLSearchParams](#urlsearchparams)\n  - [Query string](#query-string-older-browsers)\n  - [🆕 Automatic serialization](#-automatic-serialization-to-urlsearchparams)\n- [Using multipart\u002Fform-data format](#using-multipartform-data-format)\n  - [FormData](#formdata)\n  - [🆕 Automatic serialization](#-automatic-serialization-to-formdata)\n- [Files Posting](#files-posting)\n- [HTML Form Posting](#-html-form-posting-browser)\n- [🆕 Progress capturing](#-progress-capturing)\n- [🆕 Rate limiting](#-rate-limiting)\n- [🆕 AxiosHeaders](#-axiosheaders)\n- [🔥 Fetch adapter](#-fetch-adapter)\n  - [🔥 Custom fetch](#-custom-fetch)\n    - [🔥 Using with Tauri](#-using-with-tauri)\n    - [🔥 Using with SvelteKit](#-using-with-sveltekit)\n- [🔥 HTTP2](#-http2)\n- [Semver](#semver)\n- [Promises](#promises)\n- [TypeScript](#typescript)\n- [Contributing](#contributing)\n  - [Local setup](#local-setup)\n- [Resources](#resources)\n- [Credits](#credits)\n- [License](#license)\n\n## Features\n\n- **Browser Requests:** Make [XMLHttpRequests](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FXMLHttpRequest) directly from the browser.\n- **Node.js Requests:** Make [http](https:\u002F\u002Fnodejs.org\u002Fapi\u002Fhttp.html) requests from Node.js environments.\n- **Promise-based:** Fully supports the [Promise](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FPromise) API for easier asynchronous code.\n- **Interceptors:** Intercept requests and responses to add custom logic or transform data.\n- **Data Transformation:** Transform request and response data automatically.\n- **Request Cancellation:** Cancel requests using built-in mechanisms.\n- **Automatic JSON Handling:** Automatically serializes and parses [JSON](https:\u002F\u002Fwww.json.org\u002Fjson-en.html) data.\n- **Form Serialization:** 🆕 Automatically serializes data objects to `multipart\u002Fform-data` or `x-www-form-urlencoded` formats.\n- **XSRF Protection:** Client-side support to protect against [Cross-Site Request Forgery](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCross-site_request_forgery).\n\n## Browser Support\n\n|                                                     Chrome                                                     |                                                      Firefox                                                      |                                                     Safari                                                     |                                                    Opera                                                    |                                                   Edge                                                   |\n| :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: |\n| ![Chrome browser logo](https:\u002F\u002Fraw.githubusercontent.com\u002Falrra\u002Fbrowser-logos\u002Fmain\u002Fsrc\u002Fchrome\u002Fchrome_48x48.png) | ![Firefox browser logo](https:\u002F\u002Fraw.githubusercontent.com\u002Falrra\u002Fbrowser-logos\u002Fmain\u002Fsrc\u002Ffirefox\u002Ffirefox_48x48.png) | ![Safari browser logo](https:\u002F\u002Fraw.githubusercontent.com\u002Falrra\u002Fbrowser-logos\u002Fmain\u002Fsrc\u002Fsafari\u002Fsafari_48x48.png) | ![Opera browser logo](https:\u002F\u002Fraw.githubusercontent.com\u002Falrra\u002Fbrowser-logos\u002Fmain\u002Fsrc\u002Fopera\u002Fopera_48x48.png) | ![Edge browser logo](https:\u002F\u002Fraw.githubusercontent.com\u002Falrra\u002Fbrowser-logos\u002Fmain\u002Fsrc\u002Fedge\u002Fedge_48x48.png) |\n|                                                    Latest ✔                                                    |                                                     Latest ✔                                                      |                                                    Latest ✔                                                    |                                                  Latest ✔                                                   |                                                 Latest ✔                                                 |\n\n[![Browser Matrix](https:\u002F\u002Fsaucelabs.com\u002Fopen_sauce\u002Fbuild_matrix\u002Faxios.svg)](https:\u002F\u002Fsaucelabs.com\u002Fu\u002Faxios)\n\n## Installing\n\n### Package manager\n\nUsing npm:\n\n```bash\n$ npm install axios\n```\n\nUsing yarn:\n\n```bash\n$ yarn add axios\n```\n\nUsing pnpm:\n\n```bash\n$ pnpm add axios\n```\n\nUsing bun:\n\n```bash\n$ bun add axios\n```\n\nOnce the package is installed, you can import the library using `import` or `require` approach:\n\n```js\nimport axios, { isCancel, AxiosError } from 'axios';\n```\n\nYou can also use the default export, since the named export is just a re-export from the Axios factory:\n\n```js\nimport axios from 'axios';\n\nconsole.log(axios.isCancel('something'));\n```\n\nIf you use `require` for importing, **only the default export is available**:\n\n```js\nconst axios = require('axios');\n\nconsole.log(axios.isCancel('something'));\n```\n\nFor some bundlers and some ES6 linters you may need to do the following:\n\n```js\nimport { default as axios } from 'axios';\n```\n\nFor cases where something went wrong when trying to import a module into a custom or legacy environment,\nyou can try importing the module package directly:\n\n```js\nconst axios = require('axios\u002Fdist\u002Fbrowser\u002Faxios.cjs'); \u002F\u002F browser commonJS bundle (ES2017)\n\u002F\u002F const axios = require('axios\u002Fdist\u002Fnode\u002Faxios.cjs'); \u002F\u002F node commonJS bundle (ES2017)\n```\n\n### CDN\n\nUsing jsDelivr CDN (ES5 UMD browser module):\n\n```html\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Faxios@1.13.2\u002Fdist\u002Faxios.min.js\">\u003C\u002Fscript>\n```\n\nUsing unpkg CDN:\n\n```html\n\u003Cscript src=\"https:\u002F\u002Funpkg.com\u002Faxios@1.13.2\u002Fdist\u002Faxios.min.js\">\u003C\u002Fscript>\n```\n\n## Example\n\n```js\nimport axios from 'axios';\n\u002F\u002Fconst axios = require('axios'); \u002F\u002F legacy way\n\ntry {\n  const response = await axios.get('\u002Fuser?ID=12345');\n  console.log(response);\n} catch (error) {\n  console.error(error);\n}\n\n\u002F\u002F Optionally the request above could also be done as\naxios\n  .get('\u002Fuser', {\n    params: {\n      ID: 12345,\n    },\n    timeout: 5000, \u002F\u002F 5 seconds — see \"Handling Timeouts\" below for matching error handling\n  })\n  .then(function (response) {\n    console.log(response);\n  })\n  .catch(function (error) {\n    console.log(error);\n  })\n  .finally(function () {\n    \u002F\u002F always executed\n  });\n\n\u002F\u002F Want to use async\u002Fawait? Add the `async` keyword to your outer function\u002Fmethod.\nasync function getUser() {\n  try {\n\u002F\u002F Example: GET request with query parameters\nconst response = await axios.get('\u002Fuser', {\n  params: {\n    ID: 12345\n  }\n});\n\n\u002F\u002F Using the `params` option improves readability and automatically formats query strings\n\nconsole.log(response);\n  } catch (error) {\n    console.error(error);\n  }\n}\n```\n\n> **Note**: Set a `timeout` in production — without one, a stalled request can hang\n> indefinitely. See [Handling Timeouts](#handling-timeouts) for the matching error handling.\n\n> **Note**: `async\u002Fawait` is part of ECMAScript 2017 and is not supported in Internet\n> Explorer and older browsers, so use with caution.\n\nPerforming a `POST` request\n\n```js\nconst response = await axios.post('\u002Fuser', {\n  firstName: 'Fred',\n  lastName: 'Flintstone',\n});\nconsole.log(response);\n```\n\nPerforming multiple concurrent requests\n\n```js\nfunction getUserAccount() {\n  return axios.get('\u002Fuser\u002F12345');\n}\n\nfunction getUserPermissions() {\n  return axios.get('\u002Fuser\u002F12345\u002Fpermissions');\n}\n\nPromise.all([getUserAccount(), getUserPermissions()]).then(function (results) {\n  const acct = results[0];\n  const perm = results[1];\n});\n```\n\n## axios API\n\nRequests can be made by passing the relevant config to `axios`.\n\n##### axios(config)\n\n```js\n\u002F\u002F Send a POST request\naxios({\n  method: 'post',\n  url: '\u002Fuser\u002F12345',\n  data: {\n    firstName: 'Fred',\n    lastName: 'Flintstone',\n  },\n});\n```\n\n```js\n\u002F\u002F GET request for remote image in node.js\nconst response = await axios({\n  method: 'get',\n  url: 'https:\u002F\u002Fbit.ly\u002F2mTM3nY',\n  responseType: 'stream',\n});\nresponse.data.pipe(fs.createWriteStream('ada_lovelace.jpg'));\n```\n\n##### axios(url[, config])\n\n```js\n\u002F\u002F Send a GET request (default method)\naxios('\u002Fuser\u002F12345');\n```\n\n### Request method aliases\n\nFor convenience, aliases have been provided for all common request methods.\n\n##### axios.request(config)\n\n##### axios.get(url[, config])\n\n##### axios.delete(url[, config])\n\n##### axios.head(url[, config])\n\n##### axios.options(url[, config])\n\n##### axios.post(url[, data[, config]])\n\n##### axios.put(url[, data[, config]])\n\n##### axios.patch(url[, data[, config]])\n\n###### NOTE\n\nWhen using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.\n\n### Concurrency (Deprecated)\n\nPlease use `Promise.all` to replace the below functions.\n\nHelper functions for dealing with concurrent requests.\n\naxios.all(iterable)\naxios.spread(callback)\n\n### Creating an instance\n\nYou can create a new instance of axios with a custom config.\n\n##### axios.create([config])\n\n```js\nconst instance = axios.create({\n  baseURL: 'https:\u002F\u002Fsome-domain.com\u002Fapi\u002F',\n  timeout: 1000,\n  headers: { 'X-Custom-Header': 'foobar' },\n});\n```\n\n### Instance methods\n\nThe available instance methods are listed below. The specified config will be merged with the instance config.\n\n##### axios#request(config)\n\n##### axios#get(url[, config])\n\n##### axios#delete(url[, config])\n\n##### axios#head(url[, config])\n\n##### axios#options(url[, config])\n\n##### axios#post(url[, data[, config]])\n\n##### axios#put(url[, data[, config]])\n\n##### axios#patch(url[, data[, config]])\n\n##### axios#getUri([config])\n\n## Request Config\n\n### ⚠️ Security notice: decompression-bomb protection is opt-in\n\nBy default `maxContentLength` and `maxBodyLength` are `-1` (unlimited). A malicious or compromised server can return a tiny gzip\u002Fdeflate\u002Fbrotli body that expands to gigabytes and exhaust the Node.js process.\n\nIf you call servers you do not fully trust, **set a cap**:\n\n```js\naxios.defaults.maxContentLength = 10 * 1024 * 1024; \u002F\u002F 10 MB\naxios.defaults.maxBodyLength = 10 * 1024 * 1024;\n```\n\nSee the [security guide](https:\u002F\u002Faxios.rest\u002Fpages\u002Fmisc\u002Fsecurity.html) for details.\n\nThese are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified.\n\n```js\n{\n  \u002F\u002F `url` is the server URL that will be used for the request\n  url: '\u002Fuser',\n\n  \u002F\u002F `method` is the request method to be used when making the request\n  method: 'get', \u002F\u002F default\n\n  \u002F\u002F `baseURL` will be prepended to `url` unless `url` is absolute and the option `allowAbsoluteUrls` is set to true.\n  \u002F\u002F It can be convenient to set `baseURL` for an instance of axios to pass relative URLs\n  \u002F\u002F to the methods of that instance.\n  baseURL: 'https:\u002F\u002Fsome-domain.com\u002Fapi\u002F',\n\n  \u002F\u002F `allowAbsoluteUrls` determines whether or not absolute URLs will override a configured `baseUrl`.\n  \u002F\u002F When set to true (default), absolute values for `url` will override `baseUrl`.\n  \u002F\u002F When set to false, absolute values for `url` will always be prepended by `baseUrl`.\n  allowAbsoluteUrls: true,\n\n  \u002F\u002F `transformRequest` allows changes to the request data before it is sent to the server\n  \u002F\u002F This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'\n  \u002F\u002F The last function in the array must return a string or an instance of Buffer, ArrayBuffer,\n  \u002F\u002F FormData or Stream\n  \u002F\u002F You may modify the headers object.\n  transformRequest: [function (data, headers) {\n    \u002F\u002F Do whatever you want to transform the data\n\n    return data;\n  }],\n\n  \u002F\u002F `transformResponse` allows changes to the response data to be made before\n  \u002F\u002F it is passed to then\u002Fcatch\n  transformResponse: [function (data) {\n    \u002F\u002F Do whatever you want to transform the data\n\n    return data;\n  }],\n\n  \u002F\u002F `parseReviver` is an optional function that will be passed as the\n  \u002F\u002F second argument (reviver) to JSON.parse()\n  parseReviver: function (key, value, context) {\n    \u002F\u002F In modern environments, context.source provides the raw JSON string\n    \u002F\u002F allowing for precision-safe parsing of BigInt\n    if (typeof value === 'number' && context?.source) {\n      const isInteger = Number.isInteger(value);\n      const isUnsafe = !Number.isSafeInteger(value);\n      const isValidIntegerString = \u002F^-?\\d+$\u002F.test(context.source);\n\n      if (isInteger && isUnsafe && isValidIntegerString) {\n        try {\n          return BigInt(context.source);\n        } catch {\n          \u002F\u002F Fallback: return original value if parsing fails\n        }\n      }\n    }\n    return value;\n  },\n\n  \u002F\u002F `headers` are custom headers to be sent\n  headers: {'X-Requested-With': 'XMLHttpRequest'},\n\n  \u002F\u002F `params` are the URL parameters to be sent with the request\n  \u002F\u002F Must be a plain object or a URLSearchParams object\n  params: {\n    ID: 12345\n  },\n\n  \u002F\u002F `paramsSerializer` is an optional config that allows you to customize serializing `params`.\n  paramsSerializer: {\n\n    \u002F\u002F Custom encoder function which sends key\u002Fvalue pairs in an iterative fashion.\n    encode?: (param: string): string => { \u002F* Do custom operations here and return transformed string *\u002F },\n\n    \u002F\u002F Custom serializer function for the entire parameter. Allows the user to mimic pre 1.x behaviour.\n    serialize?: (params: Record\u003Cstring, any>, options?: ParamsSerializerOptions ),\n\n    \u002F\u002F Configuration for formatting array indexes in the params.\n    indexes: false, \u002F\u002F Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes).\n\n    \u002F\u002F Maximum object nesting depth when serializing params. Payloads deeper than this throw an\n    \u002F\u002F AxiosError with code ERR_FORM_DATA_DEPTH_EXCEEDED. Default: 100. Set to Infinity to disable.\n    maxDepth: 100\n\n  },\n\n  \u002F\u002F `data` is the data to be sent as the request body\n  \u002F\u002F Only applicable for request methods 'PUT', 'POST', 'DELETE', and 'PATCH'\n  \u002F\u002F When no `transformRequest` is set, it must be of one of the following types:\n  \u002F\u002F - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams\n  \u002F\u002F - Browser only: FormData, File, Blob\n  \u002F\u002F - Node only: Stream, Buffer, FormData (form-data package)\n  data: {\n    firstName: 'Fred'\n  },\n\n  \u002F\u002F `formDataHeaderPolicy` controls how node.js FormData#getHeaders() is copied.\n  \u002F\u002F 'legacy' (default) copies all returned headers for v1 compatibility.\n  \u002F\u002F 'content-only' copies only Content-Type and Content-Length.\n  formDataHeaderPolicy: 'legacy',\n\n  \u002F\u002F syntax alternative to send data into the body\n  \u002F\u002F method post\n  \u002F\u002F only the value is sent, not the key\n  data: 'Country=Brasil&City=Belo Horizonte',\n\n  \u002F\u002F `timeout` specifies the number of milliseconds before the request times out.\n  \u002F\u002F If the request takes longer than `timeout`, the request will be aborted.\n  timeout: 1000, \u002F\u002F default is `0` (no timeout)\n\n  \u002F\u002F `withCredentials` indicates whether or not cross-site Access-Control requests\n  \u002F\u002F should be made using credentials\n  \u002F\u002F This only controls whether the browser sends credentials.\n  \u002F\u002F It does not control whether the XSRF header is added.\n  withCredentials: false, \u002F\u002F default\n\n  \u002F\u002F `adapter` allows custom handling of requests which makes testing easier.\n  \u002F\u002F Return a promise and supply a valid response (see lib\u002Fadapters\u002FREADME.md)\n  adapter: function (config) {\n    \u002F* ... *\u002F\n  },\n  \u002F\u002F Also, you can set the name of the built-in adapter, or provide an array with their names\n  \u002F\u002F to choose the first available in the environment\n  adapter: 'xhr', \u002F\u002F 'fetch' | 'http' | ['xhr', 'http', 'fetch']\n\n  \u002F\u002F `auth` indicates that HTTP Basic auth should be used, and supplies credentials.\n  \u002F\u002F This will set an `Authorization` header, overwriting any existing\n  \u002F\u002F `Authorization` custom headers you have set using `headers`.\n  \u002F\u002F Please note that only HTTP Basic auth is configurable through this parameter.\n  \u002F\u002F For Bearer tokens and such, use `Authorization` custom headers instead.\n  auth: {\n    username: 'janedoe',\n    password: 's00pers3cret'\n  },\n\n  \u002F\u002F `responseType` indicates the type of data that the server will respond with\n  \u002F\u002F options are: 'arraybuffer', 'document', 'json', 'text', 'stream'\n  \u002F\u002F   browser only: 'blob'\n  responseType: 'json', \u002F\u002F default\n\n  \u002F\u002F `responseEncoding` indicates encoding to use for decoding responses (Node.js only)\n  \u002F\u002F Note: Ignored for `responseType` of 'stream' or client-side requests\n  \u002F\u002F options are: 'ascii', 'ASCII', 'ansi', 'ANSI', 'binary', 'BINARY', 'base64', 'BASE64', 'base64url',\n  \u002F\u002F 'BASE64URL', 'hex', 'HEX', 'latin1', 'LATIN1', 'ucs-2', 'UCS-2', 'ucs2', 'UCS2', 'utf-8', 'UTF-8',\n  \u002F\u002F 'utf8', 'UTF8', 'utf16le', 'UTF16LE'\n  responseEncoding: 'utf8', \u002F\u002F default\n\n  \u002F\u002F `xsrfCookieName` is the name of the cookie to use as a value for the xsrf token\n  xsrfCookieName: 'XSRF-TOKEN', \u002F\u002F default\n\n  \u002F\u002F `xsrfHeaderName` is the name of the http header that carries the xsrf token value\n  xsrfHeaderName: 'X-XSRF-TOKEN', \u002F\u002F default\n\n  \u002F\u002F `withXSRFToken` defines whether to send the XSRF header in browser requests.\n  \u002F\u002F `undefined` (default) - set XSRF header only for the same origin requests\n  \u002F\u002F `true` - always set XSRF header, including for cross-origin requests\n  \u002F\u002F `false` - never set XSRF header\n  \u002F\u002F function - resolve with custom logic; receives the internal config object\n  withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined),\n\n  \u002F\u002F `withXSRFToken` controls whether Axios reads the XSRF cookie and sets the XSRF header.\n  \u002F\u002F - `undefined` (default): the XSRF header is set only for same-origin requests.\n  \u002F\u002F - `true`: attempt to set the XSRF header for all requests (including cross-origin).\n  \u002F\u002F - `false`: never set the XSRF header.\n  \u002F\u002F - function: a callback that receives the request `config` and returns `true`,\n  \u002F\u002F   `false`, or `undefined` to decide per-request behavior.\n  \u002F\u002F\n  \u002F\u002F Note about `withCredentials`: `withCredentials` controls whether cross-site\n  \u002F\u002F requests include credentials (cookies and HTTP auth). In older Axios versions,\n  \u002F\u002F setting `withCredentials: true` implicitly caused Axios to set the XSRF header\n  \u002F\u002F for cross-origin requests. Newer Axios separates these concerns: to allow the\n  \u002F\u002F XSRF header to be sent for cross-origin requests you should set both\n  \u002F\u002F `withCredentials: true` and `withXSRFToken: true`.\n  \u002F\u002F\n  \u002F\u002F Example:\n  \u002F\u002F axios.get('\u002Fuser', { withCredentials: true, withXSRFToken: true });\n\n  \u002F\u002F `onUploadProgress` allows handling of progress events for uploads\n  \u002F\u002F browser & node.js\n  onUploadProgress: function ({loaded, total, progress, bytes, estimated, rate, upload = true}) {\n    \u002F\u002F Do whatever you want with the Axios progress event\n  },\n\n  \u002F\u002F `onDownloadProgress` allows handling of progress events for downloads\n  \u002F\u002F browser & node.js\n  onDownloadProgress: function ({loaded, total, progress, bytes, estimated, rate, download = true}) {\n    \u002F\u002F Do whatever you want with the Axios progress event\n  },\n\n  \u002F\u002F `maxContentLength` defines the max size of the http response content in bytes allowed in node.js\n  maxContentLength: 2000,\n\n  \u002F\u002F `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed\n  maxBodyLength: 2000,\n\n  \u002F\u002F `redact` masks matching config keys when AxiosError#toJSON() is called.\n  \u002F\u002F Matching is case-insensitive and recursive. It does not change the request.\n  redact: ['authorization', 'password'],\n\n  \u002F\u002F `validateStatus` defines whether to resolve or reject the promise for a given\n  \u002F\u002F HTTP response status code. If `validateStatus` returns `true` (or is set to `null`\n  \u002F\u002F or `undefined`), the promise will be resolved; otherwise, the promise will be\n  \u002F\u002F rejected.\n  validateStatus: function (status) {\n    return status >= 200 && status \u003C 300; \u002F\u002F default\n  },\n\n  \u002F\u002F `maxRedirects` defines the maximum number of redirects to follow in node.js.\n  \u002F\u002F If set to 0, no redirects will be followed.\n  maxRedirects: 21, \u002F\u002F default\n\n  \u002F\u002F `beforeRedirect` defines a function that will be called before redirect.\n  \u002F\u002F Use this to adjust the request options upon redirecting,\n  \u002F\u002F to inspect the latest response headers,\n  \u002F\u002F or to cancel the request by throwing an error\n  \u002F\u002F If maxRedirects is set to 0, `beforeRedirect` is not used.\n\n  beforeRedirect: (options, { headers }) => {\n    if (\n      options.hostname === \"example.com\" &&\n      options.protocol === \"https:\"\n    ) {\n      options.auth = \"user:password\";\n    }\n  },\n  \u002F\u002F Security note:\n  \u002F\u002F The `beforeRedirect` hook runs after sensitive headers are stripped during redirects.\n  \u002F\u002FThe `follow-redirects` library removes credentials on protocol downgrade (HTTPS → HTTP) for security.\n  \u002F\u002FSince `beforeRedirect` runs after this, re-injecting credentials without checking the   protocol can expose sensitive data.\n  \u002F\u002FAlways ensure credentials are only added for trusted HTTPS destinations.\n\n\u002F\u002F Security note:\n\u002F\u002F The beforeRedirect hook runs after sensitive headers are stripped during redirects.\n\u002F\u002F Re-injecting credentials without checking the destination can expose sensitive data.\n\u002F\u002F Only add credentials for trusted HTTPS destinations.\n\u002F\u002F Avoid re-adding credentials on downgraded redirects.\n\n\n  \u002F\u002F `socketPath` defines a UNIX Socket to be used in node.js.\n  \u002F\u002F e.g. '\u002Fvar\u002Frun\u002Fdocker.sock' to send requests to the docker daemon.\n  \u002F\u002F Only either `socketPath` or `proxy` can be specified.\n  \u002F\u002F If both are specified, `socketPath` is used.\n  \u002F\u002F\n  \u002F\u002F Security: when `socketPath` is set, hostname\u002Fport of the URL are ignored,\n  \u002F\u002F which bypasses hostname-based SSRF protections. Never derive `socketPath`\n  \u002F\u002F from untrusted input. Use `allowedSocketPaths` (below) to restrict accepted\n  \u002F\u002F socket paths for defense-in-depth.\n  socketPath: null, \u002F\u002F default\n\n  \u002F\u002F `allowedSocketPaths` restricts which `socketPath` values are accepted.\n  \u002F\u002F Accepts a string or array of strings. Entries and the incoming socketPath\n  \u002F\u002F are compared after path.resolve(). A mismatch throws AxiosError with code\n  \u002F\u002F `ERR_BAD_OPTION_VALUE`. When null\u002Fundefined, no restriction is applied.\n  allowedSocketPaths: null, \u002F\u002F default\n\n  \u002F\u002F `transport` determines the transport method that will be used to make the request.\n  \u002F\u002F If defined, it will be used. Otherwise, if `maxRedirects` is 0,\n  \u002F\u002F the default `http` or `https` library will be used, depending on the protocol specified in `protocol`.\n  \u002F\u002F Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol,\n  \u002F\u002F which can handle redirects.\n  transport: undefined, \u002F\u002F default\n\n  \u002F\u002F `httpAgent` and `httpsAgent` define a custom agent to be used when performing http\n  \u002F\u002F and https requests, respectively, in node.js. This allows options to be added like\n  \u002F\u002F `keepAlive` that are not enabled by default before Node.js v19.0.0. After Node.js\n  \u002F\u002F v19.0.0, you no longer need to customize the agent to enable `keepAlive` because\n  \u002F\u002F `http.globalAgent` has `keepAlive` enabled by default.\n  httpAgent: new http.Agent({ keepAlive: true }),\n  httpsAgent: new https.Agent({ keepAlive: true }),\n\n  \u002F\u002F `proxy` defines the hostname, port, and protocol of the proxy server.\n  \u002F\u002F You can also define your proxy using the conventional `http_proxy` and\n  \u002F\u002F `https_proxy` environment variables. If you are using environment variables\n  \u002F\u002F for your proxy configuration, you can also define a `no_proxy` environment\n  \u002F\u002F variable as a comma-separated list of domains that should not be proxied.\n  \u002F\u002F Use `false` to disable proxies, ignoring environment variables.\n  \u002F\u002F `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and\n  \u002F\u002F supplies credentials.\n  \u002F\u002F For `http:\u002F\u002F` targets, axios sends the request to the proxy in\n  \u002F\u002F forward-proxy mode and stamps `Proxy-Authorization` onto the request\n  \u002F\u002F headers (overwriting any user-supplied `Proxy-Authorization` header).\n  \u002F\u002F For `https:\u002F\u002F` targets, axios establishes a CONNECT tunnel through the\n  \u002F\u002F proxy and performs TLS end-to-end with the origin; `Proxy-Authorization`\n  \u002F\u002F is sent on the CONNECT request only, never on the wrapped TLS request,\n  \u002F\u002F so the proxy never sees the URL, headers, or body. Supply a custom\n  \u002F\u002F `httpsAgent` to opt out of automatic CONNECT tunneling.\n  \u002F\u002F If the proxy server uses HTTPS, then you must set the protocol to `https`.\n  \u002F\u002F A user-supplied `Host` header in `headers` is preserved when forwarding\n  \u002F\u002F through a proxy (case-insensitive match on `host`\u002F`Host`\u002F`HOST`); this\n  \u002F\u002F lets you target a virtual host that differs from the request URL — for\n  \u002F\u002F example, hitting `127.0.0.1:4000` while having the proxy treat the\n  \u002F\u002F request as `example.com`. If no `Host` header is supplied, axios\n  \u002F\u002F defaults it to the request URL's `hostname:port` as before. The Host\n  \u002F\u002F header is only set in forward-proxy mode (HTTP targets); for HTTPS\n  \u002F\u002F tunneling the Host header is sent inside the TLS connection, not seen\n  \u002F\u002F by the proxy.\n  proxy: {\n    protocol: 'https',\n    host: '127.0.0.1',\n    \u002F\u002F hostname: '127.0.0.1' \u002F\u002F Takes precedence over 'host' if both are defined\n    port: 9000,\n    auth: {\n      username: 'mikeymike',\n      password: 'rapunz3l'\n    }\n  },\n\n  \u002F\u002F `cancelToken` specifies a cancel token that can be used to cancel the request\n  \u002F\u002F (see Cancellation section below for details)\n  cancelToken: new CancelToken(function (cancel) {\n  }),\n\n  \u002F\u002F an alternative way to cancel Axios requests using AbortController\n  signal: new AbortController().signal,\n\n  \u002F\u002F `decompress` indicates whether or not the response body should be decompressed\n  \u002F\u002F automatically. If set to `true` will also remove the 'content-encoding' header\n  \u002F\u002F from the responses objects of all decompressed responses\n  \u002F\u002F - Node only (XHR cannot turn off decompression)\n  decompress: true, \u002F\u002F default\n\n  \u002F\u002F `insecureHTTPParser` boolean.\n  \u002F\u002F Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers.\n  \u002F\u002F This may allow interoperability with non-conformant HTTP implementations.\n  \u002F\u002F Using the insecure parser should be avoided.\n  \u002F\u002F see options https:\u002F\u002Fnodejs.org\u002Fdist\u002Flatest-v12.x\u002Fdocs\u002Fapi\u002Fhttp.html#http_http_request_url_options_callback\n  \u002F\u002F see also https:\u002F\u002Fnodejs.org\u002Fen\u002Fblog\u002Fvulnerability\u002Ffebruary-2020-security-releases\u002F#strict-http-header-parsing-none\n  insecureHTTPParser: undefined, \u002F\u002F default\n\n  \u002F\u002F transitional options for backward compatibility that may be removed in the newer versions\n  transitional: {\n    \u002F\u002F silent JSON parsing mode\n    \u002F\u002F `true`  - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour)\n    \u002F\u002F `false` - throw SyntaxError if JSON parsing failed\n    \u002F\u002F Important: this option only takes effect when `responseType` is explicitly set to 'json'.\n    \u002F\u002F When `responseType` is omitted (defaults to no value), axios uses `forcedJSONParsing`\n    \u002F\u002F to attempt JSON parsing, but will silently return the raw string on failure regardless\n    \u002F\u002F of this setting. To have invalid JSON throw errors, use:\n    \u002F\u002F   { responseType: 'json', transitional: { silentJSONParsing: false } }\n    silentJSONParsing: true, \u002F\u002F default value for the current Axios version\n\n    \u002F\u002F try to parse the response string as JSON even if `responseType` is not 'json'\n    forcedJSONParsing: true,\n\n    \u002F\u002F throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts\n    clarifyTimeoutError: false,\n\n    \u002F\u002F use the legacy interceptor request\u002Fresponse ordering\n    legacyInterceptorReqResOrdering: true, \u002F\u002F default\n  },\n\n  env: {\n    \u002F\u002F The FormData class to be used to automatically serialize the payload into a FormData object\n    FormData: window?.FormData || global?.FormData\n  },\n\n  formSerializer: {\n      visitor: (value, key, path, helpers) => {}; \u002F\u002F custom visitor function to serialize form values\n      dots: boolean; \u002F\u002F use dots instead of brackets format\n      metaTokens: boolean; \u002F\u002F keep special endings like {} in parameter key\n      indexes: boolean; \u002F\u002F array indexes format null - no brackets, false - empty brackets, true - brackets with indexes\n      maxDepth: 100; \u002F\u002F maximum object nesting depth; throws AxiosError (ERR_FORM_DATA_DEPTH_EXCEEDED) if exceeded. Set to Infinity to disable.\n  },\n\n  \u002F\u002F http adapter only (node.js)\n  maxRate: [\n    100 * 1024, \u002F\u002F 100KB\u002Fs upload limit,\n    100 * 1024  \u002F\u002F 100KB\u002Fs download limit\n  ]\n}\n```\n\n### Strict RFC 3986 percent-encoding for query params\n\nBy default, axios decodes `%3A`, `%24`, `%2C` and `%20` back to `:`, `$`, `,` and `+` for readability (the `+` follows the `application\u002Fx-www-form-urlencoded` convention for spaces in query strings). These characters are valid in a query component under [RFC 3986](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc3986#section-3.4), so the default output is correct, but some backends require strict percent-encoding and reject the readable form.\n\nOverride the default encoder via `paramsSerializer.encode`:\n\n```js\n\u002F\u002F Per-request: emit strict RFC 3986 percent-encoding for query values\naxios.get('\u002Ffoo', {\n  params: { filter: JSON.stringify({ startedAt: '2026-01-23' }) },\n  paramsSerializer: { encode: encodeURIComponent }\n});\n\n\u002F\u002F Or set it on the instance defaults\nconst client = axios.create({\n  paramsSerializer: { encode: encodeURIComponent }\n});\n```\n\n## 🔥 HTTP\u002F2 Support\n\nAxios has experimental HTTP\u002F2 support available via the Node.js HTTP adapter.\n\nSupport depends on the runtime environment and Node.js version. Features like redirects and some behaviors may not be fully supported with HTTP\u002F2.\n\nOptions like `httpVersion` and `http2Options` are adapter-specific and may not work consistently across all environments.\n\nIf HTTP\u002F2 functionality is required, ensure your runtime environment supports it or consider using alternative libraries or custom adapters.\n\n## Response Schema\n\nThe response to a request contains the following information.\n\n```js\n{\n  \u002F\u002F `data` is the response that was provided by the server\n  data: {},\n\n  \u002F\u002F `status` is the HTTP status code from the server response\n  status: 200,\n\n  \u002F\u002F `statusText` is the HTTP status message from the server response\n  statusText: 'OK',\n\n  \u002F\u002F `headers` the HTTP headers that the server responded with\n  \u002F\u002F All header names are lowercase and can be accessed using the bracket notation.\n  \u002F\u002F Example: `response.headers['content-type']`\n  headers: {},\n\n  \u002F\u002F `config` is the config that was provided to `axios` for the request\n  config: {},\n\n  \u002F\u002F `request` is the request that generated this response\n  \u002F\u002F It is the last ClientRequest instance in node.js (in redirects)\n  \u002F\u002F and an XMLHttpRequest instance in the browser\n  request: {}\n}\n```\n\nWhen using `then`, you will receive the response as follows:\n\n```js\nconst response = await axios.get('\u002Fuser\u002F12345');\nconsole.log(response.data);\nconsole.log(response.status);\nconsole.log(response.statusText);\nconsole.log(response.headers);\nconsole.log(response.config);\n```\n\nWhen using `catch`, or passing a [rejection callback](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FPromise\u002Fthen) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section.\n\n## Config Defaults\n\nYou can specify config defaults that will be applied to every request.\n\n### Global axios defaults\n\n```js\naxios.defaults.baseURL = 'https:\u002F\u002Fapi.example.com';\n\n\u002F\u002F Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them.\n\u002F\u002F See below for an example using Custom instance defaults instead.\naxios.defaults.headers.common['Authorization'] = AUTH_TOKEN;\n\naxios.defaults.headers.post['Content-Type'] = 'application\u002Fx-www-form-urlencoded';\n```\n\n### Custom instance defaults\n\n```js\n\u002F\u002F Set config defaults when creating the instance\nconst instance = axios.create({\n  baseURL: 'https:\u002F\u002Fapi.example.com',\n});\n\n\u002F\u002F Alter defaults after instance has been created\ninstance.defaults.headers.common['Authorization'] = AUTH_TOKEN;\n```\n\n### Config order of precedence\n\nConfig will be merged with an order of precedence. The order is library defaults found in [lib\u002Fdefaults\u002Findex.js](https:\u002F\u002Fgithub.com\u002Faxios\u002Faxios\u002Fblob\u002Fmain\u002Flib\u002Fdefaults\u002Findex.js#L49), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.\n\n```js\n\u002F\u002F Create an instance using the config defaults provided by the library\n\u002F\u002F At this point the timeout config value is `0` as is the default for the library\nconst instance = axios.create();\n\n\u002F\u002F Override timeout default for the library\n\u002F\u002F Now all requests using this instance will wait 2.5 seconds before timing out\ninstance.defaults.timeout = 2500;\n\n\u002F\u002F Override timeout for this request as it's known to take a long time\ninstance.get('\u002FlongRequest', {\n  timeout: 5000,\n});\n```\n\n## Interceptors\n\nYou can intercept requests or responses before methods like `.get()` or `.post()`\nresolve their promises (before code inside `then` or `catch`, or after `await`)\n\n```js\nconst instance = axios.create();\n\n\u002F\u002F Add a request interceptor\ninstance.interceptors.request.use(\n  function (config) {\n    \u002F\u002F Do something before the request is sent\n    return config;\n  },\n  function (error) {\n    \u002F\u002F Do something with the request error\n    return Promise.reject(error);\n  }\n);\n\n\u002F\u002F Add a response interceptor\ninstance.interceptors.response.use(\n  function (response) {\n    \u002F\u002F Any status code that lies within the range of 2xx causes this function to trigger\n    \u002F\u002F Do something with response data\n    return response;\n  },\n  function (error) {\n    \u002F\u002F Any status codes that fall outside the range of 2xx cause this function to trigger\n    \u002F\u002F Do something with response error\n    return Promise.reject(error);\n  }\n);\n```\n\nIf you need to remove an interceptor later you can.\n\n```js\nconst instance = axios.create();\nconst myInterceptor = instance.interceptors.request.use(function () {\n  \u002F*...*\u002F\n});\ninstance.interceptors.request.eject(myInterceptor);\n```\n\nYou can also clear all interceptors for requests or responses.\n\n```js\nconst instance = axios.create();\ninstance.interceptors.request.use(function () {\n  \u002F*...*\u002F\n});\ninstance.interceptors.request.clear(); \u002F\u002F Removes interceptors from requests\ninstance.interceptors.response.use(function () {\n  \u002F*...*\u002F\n});\ninstance.interceptors.response.clear(); \u002F\u002F Removes interceptors from responses\n```\n\nYou can add interceptors to a custom instance of axios.\n\n```js\nconst instance = axios.create();\ninstance.interceptors.request.use(function () {\n  \u002F*...*\u002F\n});\n```\n\nWhen you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay\nin the execution of your axios request when the main thread is blocked (a promise is created under the hood for\nthe interceptor and your request gets put at the bottom of the call stack). If your request interceptors are synchronous you can add a flag\nto the options object that will tell axios to run the code synchronously and avoid any delays in request execution.\n\n```js\naxios.interceptors.request.use(\n  function (config) {\n    config.headers.test = 'I am only a header!';\n    return config;\n  },\n  null,\n  { synchronous: true }\n);\n```\n\nIf you want to execute a particular interceptor based on a runtime check,\nyou can add a `runWhen` function to the options object. The request interceptor will not be executed **if and only if** the return\nof `runWhen` is `false`. The function will be called with the config\nobject (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an\nasynchronous request interceptor that only needs to run at certain times.\n\n```js\nfunction onGetCall(config) {\n  return config.method === 'get';\n}\naxios.interceptors.request.use(\n  function (config) {\n    config.headers.test = 'special get headers';\n    return config;\n  },\n  null,\n  { runWhen: onGetCall }\n);\n```\n\n> **Note:** The options parameter(having `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment.\n\n### Interceptor Execution Order\n\n**Important:** Interceptors have different execution orders depending on their type!\n\nRequest interceptors are executed in **reverse order** (LIFO - Last In, First Out). This means the _last_ interceptor added is executed **first**.\n\nResponse interceptors are executed in the **order they were added** (FIFO - First In, First Out). This means the _first_ interceptor added is executed **first**.\n\nExample:\n\n```js\nconst instance = axios.create();\n\nconst interceptor = (id) => (base) => {\n  console.log(id);\n  return base;\n};\n\ninstance.interceptors.request.use(interceptor('Request Interceptor 1'));\ninstance.interceptors.request.use(interceptor('Request Interceptor 2'));\ninstance.interceptors.request.use(interceptor('Request Interceptor 3'));\ninstance.interceptors.response.use(interceptor('Response Interceptor 1'));\ninstance.interceptors.response.use(interceptor('Response Interceptor 2'));\ninstance.interceptors.response.use(interceptor('Response Interceptor 3'));\n\n\u002F\u002F Console output:\n\u002F\u002F Request Interceptor 3\n\u002F\u002F Request Interceptor 2\n\u002F\u002F Request Interceptor 1\n\u002F\u002F [HTTP request is made]\n\u002F\u002F Response Interceptor 1\n\u002F\u002F Response Interceptor 2\n\u002F\u002F Response Interceptor 3\n```\n\n### Multiple Interceptors\n\nGiven that you add multiple response interceptors\nand when the response was fulfilled\n\n- then each interceptor is executed\n- then they are executed in the order they were added\n- then only the last interceptor's result is returned\n- then every interceptor receives the result of its predecessor\n- and when the fulfillment-interceptor throws\n  - then the following fulfillment-interceptor is not called\n  - then the following rejection-interceptor is called\n  - once caught, another following fulfill-interceptor is called again (just like in a promise chain).\n\nRead [the interceptor tests](.\u002Ftest\u002Fspecs\u002Finterceptors.spec.js) to see all this in code.\n\n## Error Types\n\nThere are many different axios error messages that can appear which can provide basic information about the specifics of the error and where opportunities may lie in debugging.\n\nThe general structure of axios errors is as follows:\n| Property | Definition |\n| -------- | ---------- |\n| message | A quick summary of the error message and the status it failed with. |\n| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. |\n| stack | Provides the stack trace of the error. |\n| config | An axios config object with specific instance configurations defined by the user from when the request was made |\n| code | Represents an axios identified error. The table below lists specific definitions for internal axios error. |\n| status | HTTP response status code. See [here](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FList_of_HTTP_status_codes) for common HTTP response status code meanings.\n\nBelow is a list of potential axios identified error:\n\n| Code                      | Definition                                                                                                                                                                                                                                                                                                                                                                                     |\n| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ERR_BAD_OPTION_VALUE      | Invalid value provided in axios configuration.                                                                                                                                                                                                                                                                                                                                                 |\n| ERR_BAD_OPTION            | Invalid option provided in axios configuration.                                                                                                                                                                                                                                                                                                                                                |\n| ERR_NOT_SUPPORT           | Feature or method not supported in the current axios environment.                                                                                                                                                                                                                                                                                                                              |\n| ERR_DEPRECATED            | Deprecated feature or method used in axios.                                                                                                                                                                                                                                                                                                                                                    |\n| ERR_INVALID_URL           | Invalid URL provided for axios request.                                                                                                                                                                                                                                                                                                                                                        |\n| ECONNABORTED              | Typically indicates that the request has been timed out (unless `transitional.clarifyTimeoutError` is set) or aborted by the browser or its plugin.                                                                                                                                                                                                                                            |\n| ERR_CANCELED              | Feature or method is canceled explicitly by the user using an AbortSignal (or a CancelToken).                                                                                                                                                                                                                                                                                                  |\n| ETIMEDOUT                 | Request timed out due to exceeding the default axios timelimit. `transitional.clarifyTimeoutError` must be set to `true`, otherwise a generic `ECONNABORTED` error will be thrown instead.                                                                                                                                                                                                     |\n| ERR_NETWORK               | Network-related issue. In the browser, this error can also be caused by a [CORS](https:\u002F\u002Fdeveloper.mozilla.org\u002Fru\u002Fdocs\u002FWeb\u002FHTTP\u002FGuides\u002FCORS) or [Mixed Content](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FSecurity\u002FMixed_content) policy violation. The browser does not allow the JS code to clarify the real reason for the error caused by security issues, so please check the console. |\n| ERR_FR_TOO_MANY_REDIRECTS | Request is redirected too many times; exceeds max redirects specified in axios configuration.                                                                                                                                                                                                                                                                                                  |\n| ERR_BAD_RESPONSE          | Response cannot be parsed properly or is in an unexpected format. Usually related to a response with `5xx` status code.                                                                                                                                                                                                                                                                        |\n| ERR_BAD_REQUEST           | The request has an unexpected format or is missing required parameters. Usually related to a response with `4xx` status code.                                                                                                                                                                                                                                                                  |\n\n## Handling Errors\n\nThe default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error.\n\n```js\naxios.get('\u002Fuser\u002F12345').catch(function (error) {\n  if (error.response) {\n    \u002F\u002F The request was made and the server responded with a status code\n    \u002F\u002F that falls out of the range of 2xx\n    console.log(error.response.data);\n    console.log(error.response.status);\n    console.log(error.response.headers);\n  } else if (error.request) {\n    \u002F\u002F The request was made but no response was received\n    \u002F\u002F `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n    \u002F\u002F http.ClientRequest in node.js\n    console.log(error.request);\n  } else {\n    \u002F\u002F Something happened in setting up the request that triggered an Error\n    console.log('Error', error.message);\n  }\n  console.log(error.config);\n});\n```\n\nUsing the `validateStatus` config option, you can override the default condition (status >= 200 && status \u003C 300) and define HTTP code(s) that should throw an error.\n\n```js\naxios.get('\u002Fuser\u002F12345', {\n  validateStatus: function (status) {\n    return status \u003C 500; \u002F\u002F Resolve only if the status code is less than 500\n  },\n});\n```\n\nUsing `toJSON` you get an object with more information about the HTTP error.\n\n```js\naxios.get('\u002Fuser\u002F12345').catch(function (error) {\n  console.log(error.toJSON());\n});\n```\n\nTo avoid logging secrets from `error.config`, pass a `redact` array in the request config. Matching config keys are masked case-insensitively at any depth when `AxiosError#toJSON()` is called.\n\n```js\naxios.get('\u002Fuser\u002F12345', {\n  headers: { Authorization: 'Bearer token' },\n  redact: ['authorization']\n}).catch(function (error) {\n  console.log(error.toJSON().config.headers.Authorization); \u002F\u002F [REDACTED ****]\n});\n```\n\n## Handling Timeouts\n\n```js\nasync function fetchWithTimeout() {\n  try {\n    const response = await axios.get('https:\u002F\u002Fexample.com\u002Fdata', {\n      timeout: 5000, \u002F\u002F 5 seconds\n      transitional: {\n        \u002F\u002F set to true if you prefer ETIMEDOUT over ECONNABORTED\n        clarifyTimeoutError: false,\n      },\n    });\n\n    console.log('Response:', response.data);\n  } catch (error) {\n    if (axios.isAxiosError(error)) {\n      if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {\n        console.error('Request timed out. Please try again.');\n        return;\n      }\n\n      console.error('Axios error:', error.message);\n      return;\n    }\n\n    console.error('Unexpected error:', error);\n  }\n}\n```\n\n## Cancellation\n\n### AbortController\n\nStarting from `v0.22.0` Axios supports AbortController to cancel requests in a fetch API way:\n\n```js\nconst controller = new AbortController();\n\naxios\n  .get('\u002Ffoo\u002Fbar', {\n    signal: controller.signal,\n  })\n  .then(function (response) {\n    \u002F\u002F...\n  });\n\u002F\u002F cancel the request\ncontroller.abort();\n```\n\n### CancelToken `👎deprecated`\n\nYou can also cancel a request using a _CancelToken_.\n\n> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https:\u002F\u002Fgithub.com\u002Ftc39\u002Fproposal-cancelable-promises).\n\n> This API is deprecated since v0.22.0 and shouldn't be used in new projects\n\nYou can create a cancel token using the `CancelToken.source` factory as shown below:\n\n```js\nconst CancelToken = axios.CancelToken;\nconst source = CancelToken.source();\n\naxios\n  .get('\u002Fuser\u002F12345', {\n    cancelToken: source.token,\n  })\n  .catch(function (thrown) {\n    if (axios.isCancel(thrown)) {\n      console.log('Request canceled', thrown.message);\n    } else {\n      \u002F\u002F handle error\n    }\n  });\n\naxios.post(\n  '\u002Fuser\u002F12345',\n  {\n    name: 'new name',\n  },\n  {\n    cancelToken: source.token,\n  }\n);\n\n\u002F\u002F cancel the request (the message parameter is optional)\nsource.cancel('Operation canceled by the user.');\n```\n\nYou can also create a cancel token by passing an executor function to the `CancelToken` constructor:\n\n```js\nconst CancelToken = axios.CancelToken;\nlet cancel;\n\naxios.get('\u002Fuser\u002F12345', {\n  cancelToken: new CancelToken(function executor(c) {\n    \u002F\u002F An executor function receives a cancel function as a parameter\n    cancel = c;\n  }),\n});\n\n\u002F\u002F cancel the request\ncancel();\n```\n\n> **Note:** you can cancel several requests with the same cancel token\u002Fabort controller.\n> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make a real request.\n\n> During the transition period, you can use both cancellation APIs, even for the same request:\n\n## Using `application\u002Fx-www-form-urlencoded` format\n\n### URLSearchParams\n\nBy default, axios serializes JavaScript objects to `JSON`. To send data in the [`application\u002Fx-www-form-urlencoded`](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTTP\u002FMethods\u002FPOST) format instead, you can use the [`URLSearchParams`](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FURLSearchParams) API, which is [supported](http:\u002F\u002Fwww.caniuse.com\u002F#feat=urlsearchparams) in the vast majority of browsers, and [Node](https:\u002F\u002Fnodejs.org\u002Fapi\u002Furl.html#url_class_urlsearchparams) starting with v10 (released in 2018).\n\n```js\nconst params = new URLSearchParams({ foo: 'bar' });\nparams.append('extraparam', 'value');\naxios.post('\u002Ffoo', params);\n```\n\n### Query string (Older browsers)\n\nFor compatibility with very old browsers, there is a [polyfill](https:\u002F\u002Fgithub.com\u002FWebReflection\u002Furl-search-params) available (make sure to polyfill the global environment).\n\nAlternatively, you can encode data using the [`qs`](https:\u002F\u002Fgithub.com\u002Fljharb\u002Fqs) library:\n\n```js\nconst qs = require('qs');\naxios.post('\u002Ffoo', qs.stringify({ bar: 123 }));\n```\n\nOr in another way (ES6),\n\n```js\nimport qs from 'qs';\nconst data = { bar: 123 };\nconst options = {\n  method: 'POST',\n  headers: { 'content-type': 'application\u002Fx-www-form-urlencoded' },\n  data: qs.stringify(data),\n  url,\n};\naxios(options);\n```\n\n### Older Node.js versions\n\nFor older Node.js engines, you can use the [`querystring`](https:\u002F\u002Fnodejs.org\u002Fapi\u002Fquerystring.html) module as follows:\n\n```js\nconst querystring = require('querystring');\naxios.post('https:\u002F\u002Fsomething.com\u002F', querystring.stringify({ foo: 'bar' }));\n```\n\nYou can also use the [`qs`](https:\u002F\u002Fgithub.com\u002Fljharb\u002Fqs) library.\n\n> **Note**: The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https:\u002F\u002Fgithub.com\u002Fnodejs\u002Fnode-v0.x-archive\u002Fissues\u002F1665) with that use case.\n\n### 🆕 Automatic serialization to URLSearchParams\n\nAxios will automatically serialize the data objec","Axios 是一个基于 Promise 的 HTTP 客户端，适用于浏览器和 Node.js 环境。它支持拦截请求和响应、转换请求和响应数据，并自动将 JSON 数据转换为 JavaScript 对象。此外，Axios 还可以取消请求、自动处理网络错误等。其核心功能包括易于使用的 API、支持多种请求配置选项以及强大的错误处理机制。Axios 适合用于需要进行 HTTP 请求的前端和后端项目，尤其是在需要跨平台支持或对异步操作有较高要求的应用场景中。","2026-06-17 02:30:56","trending"]