Dictionary
Axios
Axios is a promise-based HTTP client that works in both browser and Node.js environments, providing a clean API for making HTTP requests. It handles request and response transformations, automatic JSON serialization and deserialization, and provides interceptors that can modify requests or responses before they are handled by application code.
The interceptor system is particularly useful in real-world applications. Request interceptors can attach authentication tokens to every outgoing request, while response interceptors can handle token refresh flows, standardize error formats, or log API calls. Axios also supports request cancellation through AbortController, timeout configuration, and progress tracking for file uploads.
For web development, Axios remains widely adopted despite the Fetch API being available natively in all modern browsers. Its consistent behavior across environments, built-in XSRF protection, automatic request body serialization, and more intuitive error handling where non-2xx status codes reject the promise rather than resolving make it a practical choice. Many teams create a configured Axios instance with base URLs, default headers, and shared interceptor logic used consistently across the application.