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 explain 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:
/ @reactwithmasoud
Auf dieser Seite können Sie das Online-Video How To GET & POST Data From API In JavaScript - Using Fetch() Function mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer React with Masoud 09 August 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,665 Mal angesehen und es wurde von 18 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!