title: How to fix Unexpected token o in JSON at position 1 using JavaScript?
body: <p>This question is seems to be already answered but my scenario is different. I am getting  Unexpected token o in JSON at position 1 everytime. Can anyone help me to fix this.Thanks</p>
  <p>here is my code</p>
  <pre><code>function send()
  {
  
      let detail = new FormData();
      detail.append(&quot;start&quot;,true);
      detail.append(&quot;user&quot;,'david');
     
  postRequest(&quot;https://myjson-url/game.php?&quot;
  ,detail, getData);
  
  }
  
  function getData(res)
  {
  
      let data = JSON.parse(res);
      console.log(data);
  
  }
  //async function
    async function checkStatus(res) {
      if (!res.ok) {
        throw new Error(await res.text());
      }
      return res;
    }
  
  //my post request
  
      function postRequest(url, info, func){
          fetch(url, {method: &quot;POST&quot;, body: info})
          .then(checkStatus)
          .then(func)
          .catch(console.error);
      }
  </code></pre>