From the course: Building React and ASP.NET Core Applications

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Testing API endpoints using Postman

Testing API endpoints using Postman

From the course: Building React and ASP.NET Core Applications

Start my 1-month free trial

Testing API endpoints using Postman

- [Instructor] So we created the API endpoints that we need, but before we consume them from the React app, let us test them using a tool named Postman. But to do so, we need to first run our application, so let's go to Visual Code. In here, to run the app, right-click and then go to Open in Terminal. And then write in here: dotnet run. So we see that the app was compiled successfully. Now let us copy this URL and go to the Postman. Click the plus button up here and then paste the URL down here. Then write: slash, API, slash, the controller name, which is Trips, and then slash, GetTrips, to get all the trips. Make sure that you have selected in here the get because we want to send an HTTP get request. So let us click the Send button. And, in here, we see that we get a list of trips. What if we want to get a single one? To get a single trip, we need to change the trips to Trips/SingleTrip and then provide, after…

Contents