Note that there are some explanatory texts on larger screens.

plurals
  1. POWith correct headers and OPTIONS request, still getting "No Access-Control-Allow-Origin header is present on the requested resource"
    text
    copied!<p>So I'm trying to make a cross-domain AJAX request with javascript.</p> <p>My OPTIONS request is executing without any problems, and I'm getting back <code>Access-Control-Allow-Origin:*</code> as a response header. However, when trying to make the subsequent POST request, I get the following error:</p> <p><code>No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://phoenix-client.local' is therefore not allowed access.</code></p> <p>I've verified multiple times that my OPTIONS request is indeed sending the correct response, including the Access-Control-Allow-Origin header, but the browser seems to ignore it :(</p> <p>Any ideas?</p> <p>edit - A couple things I've been noticing:</p> <p>If I try to update the headers my server is sending, everyone else except me gets the newly updated headers when they make a request. It's as if my computer is caching the responses to OPTIONS requests.</p> <p>This is only occurring for one of my AJAX requests. I make multiple requests before the request that fails, and all of them work fine (with the headers as is) except for the last one.</p> <p>EDIT!!!!</p> <p>Updating this post (extremely late). This ended up not being a CORS error. I get a false "Access-Control-Allow-Origin" error from Chrome, but when I run the AJAX request directly, I get the real error (which typically is supposed to be an error 500, with some sort of PHP error messaging). Still unsure why this is occurring though...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload