Fetch API - Introduction To Promised-based Data Fetching In Plain JavaScript

preview_player
Показать описание
Making server requests in JavaScript-based application is a common task. There are different ways of solving that task. Back in the day developers used the XMLHttpRequest (XHR) objects to interact with servers. For the first time it has been possible to retrieve data from a URL without having to do a full page refresh. This was one of the prerequisites to enable a web page to update just parts of the page without needed to do a full refresh.

However, using XMLHttpRequest has never felt very natural to JavaScript developers and has lead to code which is hard to read and understand. External libraries like jQuery or Axios have been trying to solve that problem and have provide better and cleaner server request APIs.

With the release of the Fetch API JavaScript has now build-in a much cleaner promised-based API which can be used to perform server request in an easy way without needing to use third-party libraries.

This tutorial is for all of you who have not worked with the Fetch API yet. In the following steps we're going to cover the Fetch API basics and learn to perform HTTP GET and POST requests with that API by implementing practical examples.

---------------------
Musik:
Night Owl by Broke For Free is licensed under a Creative Commons Attribution License.

#fetchapi #fetch #webdevelopment #javascript #frontend
Рекомендации по теме
Комментарии
Автор

Thank you very much! You are the one who explains complex things so easy and soft. Appreciate this!

maksymbykov
Автор

Hi guys, just re-uploaded the video because the video quality of the first upload was partly blurry. Problem should be solved now, sorry!

codingthesmartway
Автор

Thank you so much for this tutorial! finally had my work done :)

vividha
Автор

On the 40:10 i tried to console.log(err.statusText) but it shows an empty string any idea why it's empty sir?

salehabuhussein
Автор

Aaah, the video-quality is ok, thank you!

rockinrandalf
Автор

Please What VSCode Theme are you using?

CodeClem
Автор

Great! 👍 Any more Gatsby & React tutorials planned? They were fantastic.

adante
Автор

thank you for sharing your knowledge.
I am wondering if you can create a video related how to separate the response from the JSON part => for example create a service object where all my http-request exists out there then once i need to make a request i use this class which return a JSON object

webdeveloperguide
Автор

Can you please tell what is the point of JSON.stringify here? or anywhere else ?

salehabuhussein
Автор

turn your volume down now! I warned you.

Coral_dude