Skip to main content

API request via Axios

Axios

Axios package is a Javascript library not API. Axios use promise-based HTTP client designed for Node.js and browsers. so, we can easily send asynchronous HTTP requests to REST APIs and perform create, read, update and delete operations (CRUD). It is an open-source collaboration project hosted on Github. It can be imported in plain Javascript or with any library accordingly. 

Promise-based: Programming paradigm that uses promise object to handle asynchronous operation.

To install Axios open terminal and write the following command.

npm i axios

Then write following code in App.js and run.

carbon (7).png

and you would get the same result

Output: 

output.JPG

Read more