Answers for "json fetch data doest show"

4

json fetch data doest show

// if your json data doesn't show then just replace this code. 
handleGetJson = () =>{
  fetch(`./data.json`, {
      headers : { 
        'Content-Type': 'application/json',
        'Accept': 'application/json'
       }
    })
     .then(res=> res.json())
     .then(data=> console.log(data))
}
Posted by: Guest on October-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language