API Requests

GET Request

Perform API requests using the standard JavaScript approach of Fetch.

// API for get requests
let res = await fetch("https://jsonplaceholder.typicode.com/todos/1");
let json = await res.json();

console.log(json);

return [Object.keys(json), Object.values(json)];

Last updated