From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

GET requests

GET requests

Hello, and welcome to lesson number two of this course. In this lesson, we are going to see how we can fetch data with Fetch and Exeuse. Before starting this lesson, I want to demonstrate a GET request and making sure that you have good understanding of the GET request. Because it is the only request which has multiple cases, we are going to discuss these cases and making sure is important that you have good understanding of the HTTP request. A GET request is used to retrieve data from an API that is the backend server. So whenever you need some data only without doing any manipulation of data, then you are talking about the GET request. In the previous lesson, we used this endpoint, which was giving us all the posts. So by calling this API, we were getting all the posts available. We use this to fetch dummy posts, which the API is providing. And it's very good for demo projects and doing the testing and getting your hands dirty with Fetch or Exuse. Here's the JSON Placeholder…

Contents