Why did the post request in the ajax I sent become an OPTIONS request? how can I solve the problem with an error of 403?

Why did the post request in the ajax I sent become an OPTIONS request? how can I solve the problem with an error of 403?

                 $.ajax({
                        async: true,
                        type:"post",
                           url: "xxxxxxx",
                       contentType: "application/json;charset=UTF-8",
                           dataType:"json",
                        success:function(data){
                            console.log(data);
                        }
                    })
                    

clipboard.png

clipboard.png

Network

clipboard.png

clipboard.png

wait online!

Mar.17,2021

for cross-domain problems, browsers will send options pre-requests first, and then send real post requests after passing them. Please refer to http://javascript.ruanyifeng.


because cross-domain problems, browsers will first send an options request to see which methods are supported by the backend. The backend needs to process this request


contentType this line is deleted, which means post .

other things have been mentioned by both of you upstairs. And if you monitor the download progress, it will also become options .


Cross-domain can consider using josnp


backend processing. The backend judges that if it is an option request, it will not process it, but just deal with the get,post request


boundless longevity Buddha. How to solve it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e394-2c412.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e394-2c412.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?