php - ajax custom header submits twiceGet the solution ↓↓↓
I'm not sure why I finally sat down and tested the difference between the two in jsfiddle. The custom header addition does add in the OPTIONS preflight. I am not sure why it is double calling besides that. The only other possible outcome is a cached version getting called and then after forcing a refresh of the material that can happen if you have a inappropriately configured version of memcache or some other cacheing plugin on your webserver.
Examples of the issue with header
Example of the issue without header
As you can see from the developer tools with the added header it does the preflight options request and without it it receives just the 404.
Share solution ↓
Link To Answer People are also looking for solutions of the problem: videoxxx
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.