title: Using the Fetch API with API key header
body: <p>How do we configure the Fetch API to include the API key header?</p>
  <p>I've created an API that I can successfully receive responses from POSTMAN or Fiddler by including the API key in the headers.</p>
  <p>However, from my code (React / Javavascript) using the following snippet fails;</p>
  <pre><code>        return fetch(url)
        .then(response =&gt; response.json(),{
          mode: 'cors', 
          headers: {
            'x-api-key': '5485748746547e847483983343433243',
            'User-Agent' : 'My-App',
            'Accept': '*/*',
          },
        })
        .catch(error =&gt; console.log('Error while fetching:', error))
  </code></pre>
  <p>In Postman I can remove all the headers except the x-api-key and it works fine.  No combination of headers or configuration seems to work in my code.</p>
  <p>If I capture the request in Fiddler, the x-api-key header has not been added by the Fetch request.</p>
  <p>What is the correct way to configure fetch to send the api key header?</p>