request json fetch code example
Example 1: javascript fetch json
fetch('./yourjson.json')
.then((response) => response.json())
.then((data) => {
console.log(data);
})
Example 2: what is the request payload in jaavascript fetch
fetch('https://jsonplaceholder.typicode.com/posts/1')
.then(res => res.json())
.then(console.log)