title: Fetch with headers
body: <p>When use fetch for request in server using headers return </p>
  
  <pre><code>SyntaxError: Unexpected end of input
      at index.js:50
      at &lt;anonymous&gt;
  </code></pre>
  
  <p>Line of code 50 is }).then(res => res.json())</p>
  
  <p>What can be wrong?</p>
  
  <p>This code fetch.</p>
  
  <pre><code>fetch(api-url, {
            mode: 'no-cors',
            method: "POST",
            headers: {
                'Accept': 'application/json',
                          'Content-Type': ' application/json',
                          'X-API-SERVER': '85499f9f'
                      },
          }).then(res =&gt; res.json())
            .then(res =&gt; {
              if (res.status === 200){
                console.log("accepted");
              }else {
                console.log(res.error);
              }
  
               console.log(res.error)
            }).catch(err =&gt; console.log(err))
  </code></pre>