How to use axios on a react js project

First install axios via npm by using the following code Then add the following code to your react project If you are expecting a result that you can later use somewhere then you need to attach an event handler to the promise that gets returned from axios