Axios is a promise-based HTTP client for JavaScript environments in the browser and Node.js. It supports common request methods, configurable defaults, and interceptors for request and response handling.
Overview
Axios performs HTTP requests from browser and Node.js code using promises. Callers can issue GET, POST, PUT, PATCH, DELETE, and other methods through a shared API or method-specific shortcuts.
Request and response interceptors let applications add custom logic or transform data before promises resolve. Built-in cancellation APIs, timeout handling, and serializers for multipart form data and URL-encoded bodies cover typical client needs.
Developers install the package with common JavaScript package managers and import it into application code. Documentation covers instance creation, config merging, error handling, TypeScript types, and optional adapters such as fetch and experimental HTTP/2 in Node.
Current versions of Chrome, Firefox, Safari, Opera, and Edge are listed as supported browsers. Integration notes mention frameworks such as Tauri and SvelteKit for project-specific setup.
Key features
- Request and response interceptors
- Promise-based HTTP methods
- Request cancellation support
- Form-urlencoded and multipart serialization
- Custom axios instances and defaults
- TypeScript type declarations
- Optional fetch adapter
- Experimental Node.js HTTP/2 support
Use cases
- Calling REST APIs from browser apps
- Server-side HTTP requests in Node.js
- Concurrent parallel HTTP requests
- Uploading files with multipart forms
- Shared HTTP client configuration across a codebase