I keep getting CORS errors on my project:
Access to XMLHttpRequest at ‘http://127.0.0.1:8100/api/proses_api.php’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
I have allowed the following headers in my API:
header(“Access-Control-Allow-Methods: PUT, GET, HEAD, POST, DELETE, OPTIONS”);
header(“Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization, x-xsrf-token”);
header(“Content-Type: application/json; charset=utf-8”);
I also used the Network Inspect tool to get the headers, but as far as I can see they are already enabled within the headers:
Any advice would be appreciated