title: Why my $.ajax showing "preflight is invalid redirect error"?
body: <p>I tried the following code in <a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en">Postman</a> and it was working. Is there something wrong with the code?</p>
  
  <pre><code>$.ajax({
     url: 'http://api.example.com/users/get',
     type: 'POST',
     headers: {
        'name-api-key':'ewf45r4435trge',
     },
     data: {
        'uid':36,
     },
     success: function(data) {
        console.log(data);
     }
  });
  </code></pre>
  
  <p>I got this error in my console as below, please advise.</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="http://api.example.com/users/get">http://api.example.com/users/get</a> Response
    for preflight is invalid (redirect)</p>
  </blockquote>