CORS Blocking My Request

I include this in my backend: header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: *"); header("Content-type: application/json; charset=UTF-8"); When I want to post some data inside react redux I get this error response to preflight request doesn't pass access control check it does not have http ok status but when I delete this line code works.... http_response_code(422);
3 Replies
Keka Direktor
Keka DirektorOP13mo ago
In some case this happen, when I remove http_response_code(422);. I thing that line of code is not a prblem but idk I build my api in PHP...
vince
vince13mo ago
I have no idea about PHP but the error code is saying it needs to have a HTTP OK which is a 200, you're returning 422
Keka Direktor
Keka DirektorOP13mo ago
I find out what is a problem Thank you
Want results from more Discord servers?
Add your server