axios: Promise-based HTTP client for browsers and Node.js
Promise-based HTTP client with unified browser and Node.js interface.
Learn more about axios
axios is an HTTP client library for JavaScript that abstracts XMLHttpRequest in browsers and the http/https modules in Node.js behind a common interface. It uses native JavaScript promises to handle asynchronous operations, allowing developers to chain requests and handle responses with .then() and .catch() methods. The library supports request and response interceptors, request cancellation, automatic JSON transformation, and timeout configuration. It is commonly used in single-page applications, Node.js servers, and other JavaScript environments requiring HTTP communication.
Universal JavaScript API
Single interface works across browser and Node.js environments without code changes. Eliminates the need for separate HTTP client implementations when sharing code between frontend and backend.
Request/Response Interceptors
Middleware-like hooks intercept HTTP operations before completion. Enables centralized authentication token injection, error handling, and response transformation without repeating logic across requests.
Request Cancellation Support
Cancel in-flight requests using AbortController or cancellation tokens. Prevents memory leaks in single-page applications and handles user navigation away from pending operations.
import axios from 'axios';
const response = await axios.get('https://api.example.com/users');
const users = response.data;
console.log(users);Fixes socket hang-up crashes on keep-alive requests with timeouts and corrects http2 module export for test stubbing.
- –Upgrade to resolve 'socket hang up' errors when using keep-alive connections with configured timeouts.
- –Update if you stub http2 in tests; default export now used instead of named export for compatibility.
Fixes a regression where non-OK HTTP responses caused data streams to be interrupted unexpectedly.
- –Upgrade to restore correct streaming behavior for error responses (4xx/5xx status codes).
- –No breaking changes or new requirements; patch resolves data interruption introduced in prior release.
Adds HTTP/2 support and fixes a TypeError when config.env is undefined in fetch adapter.
- –Enable HTTP/2 for requests by configuring the new HTTP2 transport option in your axios client.
- –Update code that passes undefined config.env to fetch adapter to avoid TypeErrors in production.
See how people are using axios
Top in Backend & APIs
Related Repositories
Discover similar tools and frameworks used by developers
slick
Responsive jQuery plugin for touch-enabled content carousels.
whatsmeow
Go client library for WhatsApp web multidevice protocol.
PHPMailer
SMTP client and MIME message builder for PHP.
gson
Reflection-based Java library for JSON object conversion.
evolution-api
Node.js REST API for programmatic WhatsApp control.