Answers for "when was fetch api introduced"

8

fetch api javascript

fetch('https://apiYouWantToFetch.com/players') // returns a promise
  .then(response => response.json()) // converting promise to JSON
  .then(players => console.log(players)) // console.log to view the response
Posted by: Guest on September-01-2020
4

fetch suntax

fetch('http://example.com/movies.json')
  .then((response) => {
    return response.json();
  })
  .then((data) => {
    console.log(data);
  });
Posted by: Guest on March-16-2020
0

How to use fetch api

async function fetchText() {
    let response = await fetch('/readme.txt');
    let data = await response.text();
    console.log(data);
}Code language: JavaScript (javascript)
Posted by: Guest on May-26-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language