Axios logo

Axios

Axios is a promise-based HTTP client for the browser and Node.js with automatic JSON data transformation and request/response interceptors.

1 APIs 8 Features
ClientsHTTP ClientJavaScriptNode.js

APIs

Axios

Axios is a promise-based HTTP client for the browser and Node.js with automatic JSON data transformation and request/response interceptors.

Features

Promise-Based

Built on promises for clean async/await and .then() chaining patterns.

Browser and Node.js Support

Works in both browser and Node.js environments with automatic XHR/http adapter selection.

Automatic JSON Transformation

Automatically serializes JavaScript objects to JSON and parses JSON responses.

Request and Response Interceptors

Add custom logic to requests and responses before they are handled.

Request Cancellation

Cancel in-flight requests using AbortController or the CancelToken API.

XSRF Protection

Built-in client-side XSRF protection support.

Timeout Support

Configure request timeouts for automatic cancellation of long-running requests.

Progress Tracking

Track upload and download progress with onUploadProgress and onDownloadProgress callbacks.

Use Cases

REST API Consumption

Consume RESTful APIs from frontend applications and Node.js servers.

File Uploads

Upload files with progress tracking to backend services.

Authentication

Add auth tokens and headers automatically via request interceptors.

Data Fetching

Fetch data in React, Vue, Angular, and other JavaScript frameworks.

API Testing

Test API integrations in Node.js scripts and test suites.

Integrations

React

Commonly used for data fetching in React applications with hooks.

Vue.js

Official recommendation for HTTP requests in Vue.js applications.

Node.js

Used for server-side HTTP requests with the native http/https adapter.

TypeScript

First-class TypeScript support with bundled type definitions.

Jest

Easily mocked with jest.mock() for unit testing HTTP-dependent code.

Resources

🔗
Website
Website
🔗
Documentation
Documentation
👥
GitHubOrganization
GitHubOrganization
👥
GitHubRepository
GitHubRepository
📦
npm Package
SDK