# Axios

> A code library for sending web requests. It works in the browser and on the server.

**Field:** Software Development  
**Category:** APIs  
**Also known as:** Axios JS, axios HTTP client, Axios Library

## Think of it like

Think of it like a driver who knows each road. You hand over a box, and a reply comes back.

## Definition

Axios is a JavaScript library for sending HTTP requests. It works in the browser and in Node.js. It turns JSON answers into objects for you. It can add the same headers to every request and stop a request that takes too long. Many projects use it, though the built-in fetch now does much of the same.

## Example

Jack's app uses Axios to load orders. One setting adds his token to every request.

## Example code

```javascript
const res = await axios.get("https://api.example.com/orders/42");
console.log(res.status, res.data.total);
```

One call fetches the order, and the JSON is already an object.

## Why it matters

It makes common jobs shorter, like adding a token to each request.

## Common mistake

Adding Axios for one or two simple calls. The built-in fetch may be enough.

## Three principles

- **Browser and server.** Same code in both places.
- **JSON for you.** Answers arrive as objects.
- **Shared settings.** Headers set once for all.

## Related terms

- [HTTP Client](https://learn.benibix.com/term/development/http-client)
- [Fetch API](https://learn.benibix.com/term/development/fetch-api)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [Node.js](https://learn.benibix.com/term/development/nodejs)
- [Requests (Python)](https://learn.benibix.com/term/development/python-requests)

![Three ways to send the same GET request to an API. In JavaScript code, Axios. In Python code, Requests. In a terminal, HTTPie with the command http. All three arrows point to one endpoint, which sends back JSON.](https://learn.benibix.com/diagrams/dev3-http-clients.svg)

---

Source: https://learn.benibix.com/term/development/axios
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
