In this video I am talking about how to fetch data from api in javascript and you will learn how to use the fetch api to post data to the api as well. I prepared a sample project to connect it to a test api and you will see how send and get data from server.
Firstly, I describe the javascript fetch API and talk about which parameters can you pass to this function to have custom request headers.
Secondly, I implement the users list feature of our sample project. I use a dummy api to get the users data and convert it to json object. I also show you how to send variables to your api along with your get request.
Finally, you will see how to send data to the api and create a new user in our user app database.
00:00 Introduction
00:44 What is the sample project
01:23 The sample project structure
02:09 Useful links
03:55 Fetch all users list [Get Request]
13:53 Filter users result
17:15 Add new item [Post Request]
26:32 Question!
Links:
Project Source Code: https://github.com/mdeveloper20/javas…
Fetch API docs: https://developer.mozilla.org/en-US/d…
Support me by subscribing to my channel:
https://www.youtube.com/channel/UCEoa…
#javascript #api