title: Get request leads to 'response to preflight request doesn't pass access control check'
body: <p>I'm trying to get product information from the Bol.com open api (dutch webshop) through the following code.</p>
  
  <pre><code>const config = {
    mode: 'cors',
    headers: {
      'Access-Control-Allow-Origin':'*',
      'Access-Control-Allow-Methods': 'GET, POST, PATCH, PUT, DELETE, OPTIONS',
      'Access-Control-Allow-Headers': 'Origin, Content-Type, X-Auth-Token'
    }
  };
  
  axios.get(productUrl, config)
    .then(function (response) {
      console.log(response);
    })
    .catch(function (error) {
      console.log(error);
    });
  </code></pre>
  
  <p>When trying to run this code on my website or localhost I'm getting the following errors.</p>
  
  <p><a href="https://i.stack.imgur.com/TkSYK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TkSYK.jpg" alt="enter image description here"></a></p>
  
  <p>The link is correct (If I open the link in another tab I'm getting a json object with all the product data) so I think it's something with cors.</p>
  
  <p>After seeing this post <a href="https://stackoverflow.com/questions/35588699/response-to-preflight-request-doesnt-pass-access-control-check">Response to preflight request doesn't pass access control check</a> I turned off my CORS in Google Chrome and I was able to receive the requested data. </p>
  
  <p>However I can't ask everybody to turn off cors so I would really like to know how I can solve this problem with code. Anyone can help me out?</p>