title: How to resolve access control check: Redirect is not allowed for a preflight request?
body: <p>I have a API endpoint i.e. <a href="http://api.example.com/contact" rel="nofollow noreferrer">http://api.example.com/contact</a> and it is working when I tried to use the POST method but when I configured the SSL certificate with this then the URL is changed <a href="https://api.example.com/contact" rel="nofollow noreferrer">https://api.example.com/contact</a> but method POST is not working. I have tried with the bellow code</p>
  <pre><code>    let response = await fetch(ApiUrlConstant.getApiFullUrl(&quot;web.contact&quot;), {
        method: &quot;POST&quot;,
        headers: {
          &quot;Access-Control-Allow-Origin&quot; : &quot;https://api.example.com/&quot;,
          &quot;Content-Type&quot;: &quot;application/json;charset=utf-8&quot;,
          &quot;Access-Control-Allow-Credentials&quot;: &quot;true&quot;,
          &quot;method&quot;: &quot;POST&quot;,
        },
        body: JSON.stringify(details),
      });
      setStatus(&quot;Submit&quot;);
      let result = await response.json();
      alert(result.status);
    };
  </code></pre>
  <p>Whenever I tried method POST then I got this error</p>
  <blockquote>
  <p>www.example.com/:1 Access to fetch at 'https://api.example.com/contact' from origin 'https://www.example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.</p>
  </blockquote>
  <p>I have gone through the article and discussion on StackOverflow but in my case, It's not working. Now it's hard to understand which one is correct or where I did wrong?</p>