Making GET Requests
Fetch data and parse JSON responses.
What fetch Does
The Fetch API makes HTTP requests from the browser and returns a Promise. It is the modern replacement for the old XMLHttpRequest.
A Basic GET
Call fetch(url) with a URL. It defaults to the GET method and resolves with a Response object.
fetch("https://api.example.com/users")
.then((response) => {
console.log(response.status); // 200
});