Now that you have the view set up, it is time to actually get the data. In this video, learn how to consume an API endpoint from a React app and how to iterate through the response, to display them.
- [Instructor] So we created a table. … Now let us get the data from the web API endpoint, … then show them in that data. … For that, let's go to Visual Code. … In here, go to ClientApp, then source, … components, Trip, and the Trips file. … To get the data from the API endpoint, … we are going to use one of the lifecycle methods, … and that is going to be componentDidMount. … What this means is that we are going to send a request … to get all the trips once the UI has been loaded, … so once the component was mounted. … In here, let us write: this.populateTripsData. … Now let's create this method, … so populateTripsData. … Now what we want to do in here … is that we want to send a get request to our API endpoint. … And once we have a result with a list of trips, … we want to change the state of trips to that result. … And to send HTTP requests to our API endpoints, … we are going to use a library named Axios. … So, for that, let's install it first. … So right-click on the ClientApp, then Open in Terminal, …
- Setting up the app infrastructure
- Creating data models
- Creating, reading, updating, and deleting API endpoints
- Testing API endpoints using Postman
- Reading data from React
- Adding new data from React
- Handling errors
- Implementing Redux in an existing React app
- Implementing authentication in your React app
Skill Level Intermediate
Managing App Secrets in .NET Corewith Ervis Trupja28m 15s Intermediate
1. Setting Up the App Infrastructure
2. Setting Up Web API
3. Getting Started with React
4. Implementing Redux to an Existing React App
5. Implementing Authentication in Your React App
Where to go next44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.