Return to site
REACT: Do a simple HTTP GET
REACT: Do a simple HTTP GET
=> How to call 📞 a backend to read data via REST API in React
·
So it was time for me to learn how to interact 🔃 with backend with a react App.
And I used Axios to do so.
Axios is a simple promise-based HTTP client for the browser and node.js.
Axios provides a simple-to-use 😄 library in a small package with a very extensible interface.
So I coded 👨💻 a simple react app which:
->fetches 🐶 with axios a data object in the JSON format
->displays 📺 its fields in the middle of the screen
Here is the code 👇 if you wanna play with it, just download it⬇️, and run it from its directory with 'npm start'🚀
#react #axios #callBackend #get