title: CORS - Status 200 but error in Chrome devtools console
body: <p>I have a problem with CORS, the problem is my code is executed (<em>status 200</em>) but I have an error in Google Chrome developer console.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>function callUrl(url) {
      var xmlhttp = null;
  
      if (window.XMLHttpRequest) {
          xmlhttp = new XMLHttpRequest();
      } else if (window.ActiveXObject) {
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      if (xmlhttp !== null) {
          xmlhttp.open("POST", url, true);
          xmlhttp.withCredentials = true;
          xmlhttp.send(JSON.stringify({
          }));
      } else {
          console.error("Your browser does not support XMLHTTP.");
      }
  }
  
  callUrl('https://www.website.com/tracking?etc...');
  </code></pre>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="https://www.website.com/tracking" rel="nofollow noreferrer">https://www.website.com/tracking</a>?. The
    value of the 'Access-Control-Allow-Origin' header in the response must
    not be the wildcard '*' when the request's credentials mode is
    'include'. Origin '<a href="http://localhost:8888" rel="nofollow noreferrer">http://localhost:8888</a>' is therefore not allowed
    access. The credentials mode of requests initiated by the
    XMLHttpRequest is controlled by the withCredentials attribute.</p>
  </blockquote>
  
  <p><strong>The server configuration:</strong></p>
  
  <pre><code>"Access-Control-Allow-Origin": "*",
  "Access-Control-Allow-Credentials": true,
  </code></pre>