# AXIOS | Promise Based HTTP Client For The Browser And Node.js

**URL:** <https://onehack.st/t/axios-promise-based-http-client-for-the-browser-and-node-js/287245>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, business\
**Created:** [July 18, 2024, 8:28pm UTC](https://onehack.st/t/axios-promise-based-http-client-for-the-browser-and-node-js/287245 "2024-07-18T20:28:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarah](https://onehack.st/user_avatar/onehack.st/sarah/32/166974_2.png) [@Sarah](https://onehack.st/u/Sarah)\
**Post date:** [July 18, 2024, 8:28pm UTC](https://onehack.st/t/axios-promise-based-http-client-for-the-browser-and-node-js/287245/1 "2024-07-18T20:28:18Z")

</div>

[![](https://camo.githubusercontent.com/e56453737f3695a5d21d1393764ac1bc89032f5f4d2fc9fa486c980859347275/68747470733a2f2f6178696f732d687474702e636f6d2f6173736574732f6c6f676f2e737667)](https://axios-http.com/)

Promise based HTTP client for the browser and node.js

[**Website**](https://axios-http.com/) • [**Documentation**](https://axios-http.com/docs/intro)

[![npm version](https://camo.githubusercontent.com/7e8499e6b09cae7fe14915c0a852b7a7760d39cb23a88f04cfd485e4a57b91db/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f6178696f732e7376673f7374796c653d666c61742d737175617265)](https://www.npmjs.org/package/axios) [![CDNJS](https://camo.githubusercontent.com/4ed74c2c5061fd46c64552593a7a0da1bd6cceb15d5f873127074e38a9b07861/68747470733a2f2f696d672e736869656c64732e696f2f63646e6a732f762f6178696f732e7376673f7374796c653d666c61742d737175617265)](https://cdnjs.com/libraries/axios) [![Build status](https://camo.githubusercontent.com/643609f1156d660e2e10b8c24368aa58660611d4013f7b261c0a685cc3ea12b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6178696f732f6178696f732f63692e796d6c3f6272616e63683d76312e78266c6162656c3d4349266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/axios/axios/actions/workflows/ci.yml) [![Gitpod Ready-to-Code](https://camo.githubusercontent.com/ec5170f4c4cc8dda6b9aa18dd5ba890b1d3ba0cfbcaa694a74db9b6b7ba03d98/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476974706f642d52656164792d2d746f2d2d436f64652d626c75653f6c6f676f3d676974706f64267374796c653d666c61742d737175617265)](https://gitpod.io/#https://github.com/axios/axios) [![code coverage](https://camo.githubusercontent.com/39cab73000d0717e26b31f6bab5aa8b87d929c50cece1cd8479d07a6378be367/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6d7a61627269736b69652f6178696f732e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/mzabriskie/axios) [![install size](https://camo.githubusercontent.com/07c1513e7d5b093c9790c9a0025b4ceb2f3403b26fca9d587084d5dbb5778cca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e3f75726c3d68747470733a2f2f7061636b61676570686f6269612e636f6d2f76322f6170692e6a736f6e3f703d6178696f732671756572793d242e696e7374616c6c2e707265747479266c6162656c3d696e7374616c6c25323073697a65267374796c653d666c61742d737175617265)](https://packagephobia.now.sh/result?p=axios) [![npm bundle size](https://camo.githubusercontent.com/18b3a0214abad6d7358a040f62a97a52c7227417e1388287af739159f117784d/68747470733a2f2f696d672e736869656c64732e696f2f62756e646c6570686f6269612f6d696e7a69702f6178696f733f7374796c653d666c61742d737175617265)](https://bundlephobia.com/package/axios@latest) [![npm downloads](https://camo.githubusercontent.com/481a1fd44a688a21b67f7dc3609c69a278aa0438af7a67b180b1176259cccc1e/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f6178696f732e7376673f7374796c653d666c61742d737175617265)](https://npm-stat.com/charts.html?package=axios) [![gitter chat](https://camo.githubusercontent.com/2df80ada7d38d3ea99403f3ef6ddb2dee4b8e3d73f8214f21888acc48e105415/68747470733a2f2f696d672e736869656c64732e696f2f6769747465722f726f6f6d2f6d7a61627269736b69652f6178696f732e7376673f7374796c653d666c61742d737175617265)](https://gitter.im/mzabriskie/axios) [![code helpers](https://camo.githubusercontent.com/de0bceaed52baa4d9549f4d118507277233cccf5a1e4dd8ad041f457c915970f/68747470733a2f2f7777772e636f64657472696167652e636f6d2f6178696f732f6178696f732f6261646765732f75736572732e737667)](https://www.codetriage.com/axios/axios) [![Known Vulnerabilities](https://camo.githubusercontent.com/ad696bd7f4838a652cd7f236d9cfb5cf9945b04a5ef63a81e2724a5c2b94693b/68747470733a2f2f736e796b2e696f2f746573742f6e706d2f6178696f732f62616467652e737667)](https://snyk.io/test/npm/axios)

## Table of Contents

- [Features](https://github.com/axios/axios#features)
- [Browser Support](https://github.com/axios/axios#browser-support)
- [Installing](https://github.com/axios/axios#installing)
  - [Package manager](https://github.com/axios/axios#package-manager)
  - [CDN](https://github.com/axios/axios#cdn)

- [Example](https://github.com/axios/axios#example)
- [Axios API](https://github.com/axios/axios#axios-api)
- [Request method aliases](https://github.com/axios/axios#request-method-aliases)
- [Concurrency 👎](https://github.com/axios/axios#concurrency-deprecated)
- [Creating an instance](https://github.com/axios/axios#creating-an-instance)
- [Instance methods](https://github.com/axios/axios#instance-methods)
- [Request Config](https://github.com/axios/axios#request-config)
- [Response Schema](https://github.com/axios/axios#response-schema)
- [Config Defaults](https://github.com/axios/axios#config-defaults)
  - [Global axios defaults](https://github.com/axios/axios#global-axios-defaults)
  - [Custom instance defaults](https://github.com/axios/axios#custom-instance-defaults)
  - [Config order of precedence](https://github.com/axios/axios#config-order-of-precedence)

- [Interceptors](https://github.com/axios/axios#interceptors)
  - [Multiple Interceptors](https://github.com/axios/axios#multiple-interceptors)

- [Handling Errors](https://github.com/axios/axios#handling-errors)
- [Cancellation](https://github.com/axios/axios#cancellation)
  - [AbortController](https://github.com/axios/axios#abortcontroller)
  - [CancelToken 👎](https://github.com/axios/axios#canceltoken-deprecated)

- [Using application/x-www-form-urlencoded format](https://github.com/axios/axios#using-applicationx-www-form-urlencoded-format)
  - [URLSearchParams](https://github.com/axios/axios#urlsearchparams)
  - [Query string](https://github.com/axios/axios#query-string-older-browsers)
  - [🆕 Automatic serialization](https://github.com/axios/axios#-automatic-serialization-to-urlsearchparams)

- [Using multipart/form-data format](https://github.com/axios/axios#using-multipartform-data-format)
  - [FormData](https://github.com/axios/axios#formdata)
  - [🆕 Automatic serialization](https://github.com/axios/axios#-automatic-serialization-to-formdata)

- [Files Posting](https://github.com/axios/axios#files-posting)
- [HTML Form Posting](https://github.com/axios/axios#-html-form-posting-browser)
- [🆕 Progress capturing](https://github.com/axios/axios#-progress-capturing)
- [🆕 Rate limiting](https://github.com/axios/axios#-progress-capturing)
- [🆕 AxiosHeaders](https://github.com/axios/axios#-axiosheaders)
- [🔥 Fetch adapter](https://github.com/axios/axios#-fetch-adapter)
- [Semver](https://github.com/axios/axios#semver)
- [Promises](https://github.com/axios/axios#promises)
- [TypeScript](https://github.com/axios/axios#typescript)
- [Resources](https://github.com/axios/axios#resources)
- [Credits](https://github.com/axios/axios#credits)
- [License](https://github.com/axios/axios#license)

## Features

- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser
- Make [http](https://nodejs.org/api/http.html) requests from node.js
- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API
- Intercept request and response
- Transform request and response data
- Cancel requests
- Automatic transforms for [JSON](https://www.json.org/json-en.html) data
- 🆕 Automatic data object serialization to `multipart/form-data` and `x-www-form-urlencoded` body encodings
- Client side support for protecting against [XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery)

## Browser Support

| [![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png)](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | [![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png)](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | [![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png)](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | [![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png)](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | [![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png)](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | [![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png)](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) |
| --- | --- | --- | --- | --- | --- |
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |

[![Browser Matrix](https://camo.githubusercontent.com/1da57b5454429f42302d6c91162bcefa1fea8d288a85a0a2b0afd161a86de7ab/68747470733a2f2f73617563656c6162732e636f6d2f6f70656e5f73617563652f6275696c645f6d61747269782f6178696f732e737667)](https://saucelabs.com/u/axios)

## Continue Following The Install:

[https://github.com/axios/axios](https://github.com/axios/axios)
