Introduction to Axios

Learn about making API requests using Axios.

We'll cover the following

Axios

Axios is a promise-based HTTP client for the browser and Node.js. It is an improvement on the fetch API.

Usage

We can make multiple types of web requests to external APIs, such as get, post, and put.

The get request

Making a get request is as simple as writing axios.get(url). To handle the responses, we use .then() and .catch() since Axios uses promises. We do not need to chain another .then like we do in the fetch API.

Get hands-on with 1400+ tech skills courses.