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
On this page of the site you can watch the video online How To GET & POST Data From API In JavaScript - Using Fetch() Function with a duration of hours minute second in good quality, which was uploaded by the user React with Masoud 09 August 2020, share the link with friends and acquaintances, this video has already been watched 1,665 times on youtube and it was liked by 18 viewers. Enjoy your viewing!