How To Make an API Call In HTML (Make simple HTTP/HTTPs request in JS tutorial)

Описание к видео How To Make an API Call In HTML (Make simple HTTP/HTTPs request in JS tutorial)

Sign Up 👻👻👉 https://semicolon.dev/YouTube
(We're free online community, meet other makers!)



#html #api #call #javascript #js #coding #webdev #webdevelopment #programming We don't really make API calls in HTML but in JavaScript. But people who don't yet know are searching for this. So here we are going to type JavaScript between script tags on an HTML page and make an http request to weather API. The actual API call is made using the built-in JavaScript function fetch()

00:00 How to make API call in HTML
00:10 Starting with a blank HTML file and script tags to enter javascript
00:38 Create async function to make our API call
00:55 Assign result from fetch function to a constant, and make that call await
01:34 Convert the returned object to JSON and resolve the promise with .then() method
02:17 Make the API Call
02:31 Extract temperature property from the returned JSON object

Комментарии

Информация по комментариям в разработке