Lesson 4: Use the Fetch API to Retrieve Data
Lesson Description
In this lesson you create a website using Node.js and Express. You add some JavaScript to a website page to make calls to the Web API server using the Fetch API. You learn to retrieve the response from the Web API using the .json() method. You also learn to handle 404 status codes and how to catch network exceptions in the catch() method.
Content
Lesson Objectives 00:00
DEMO: Create a Website Using Node.js and Express 00:33
DEMO: Get a List of JSON Objects Using the Fetch API 02:09
Where the Body Comes From 03:46
DEMO: Using the .json() Method 04:41
DEMO: Get a Single JSON Object Using the Fetch API 06:08
Status Code Handling 08:33
DEMO: Viewing Status Codes 09:14
DEMO: Handling Errors in the catch() Method 11:59
Lesson Summary 13:14
Helpful Links
Samples and hands-on labs for this course: https://www.pdsa.com/YouTube
Fetch API: https://developer.mozilla.org/en-US/d...
lite-server: https://www.npmjs.com/package/lite-se...
#javascript #webapi #node #nodejs #express #fetchapi #development #programming #dotnet #dotnetcore #dotnet6 #dotnet #dotnet8 #pauldsheriff #pluralsight #youtube
Paul.About()
Hello, my name is Paul D. Sheriff and I have a passion for teaching. I have been training developers for over 35 years through books, videos, article, blog posts, and international conferences and user groups.
Paul.Contact()
Website: https://www.pdsa.com
Email: [email protected]
LinkedIn: / paulsheriff
Blog: https://blogs.pdsa.com/
Pluralsight: https://app.pluralsight.com/profile/a...
YouTube Channel: @pauldsheriff