O'Reilly logo

Mastering Spring 5 by Ranga Rao Karanam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading Todos from the API with the axios framework

We want to start using the API to fetch the todo details and use the API to insert a todo. Axios is a popular framework that is used to make RESTful API calls from React applications. Some important features of the axios framework are as follows:

  • Making RESTful API calls from the browser
  • Request and response interception
  • Transformation of JSON data
  • Protection against XSRF attacks

You can stop the todo React application and add axios by executing the npm add axios command at the Command Prompt. package.json reflects the new framework added in—axios:

"dependencies": { "axios": "^0.18.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "3.0.0" },
Make sure that you start the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required