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
Sur cette page du site, vous pouvez voir la vidéo en ligne How To GET & POST Data From API In JavaScript - Using Fetch() Function durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur React with Masoud 09 août 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,665 fois et il a aimé 18 téléspectateurs. Bon visionnage!