Getting Data Using APIs with JS and Fetch
Posted on Jun 1st, 2022
Today’s topics
- Today’s first goal is to complete the customer database.
- The next task is to prepare to start working with fetch and AJAX.
- Using JSON for data
- Basics of HTTP requests
- Make GET requests with Insomnia client
- Make GET requests using the Fetch API and display response data on a page
🎯 Project: Choose Your Own Adventure
Your assignment is to do one of the following assignments. Whichever you choose, it will be due on Monday morning.
🔖 Resources
HTTP
APIs
AJAX, Fetch, & JSON
- MDN AJAX
- MDN Fetch API
- MDN fetch() method
- CSS-Tricks article on using Fetch
- MDN Working with JSON
- Code Academy Lesson on Fetch
- AJAX explained by analogy
⭐ EXTRA/TMI
Fetch requests use JavaScript promises to handle responses. Promises are a much bigger topic than we will get into right now, but if you want to know more about what a promise is and how to use it beyond the context of AJAX requests, you can start with the MDN documentation about it.