Hi,
i have try to get an http post request with ionic but i receive this error:
Access to XMLHttpRequest at 'https://DDD.org/API/1.0/APINews.php' from origin 'http://192.168.1.22:8100' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status
I have try with POSTMAN and the server respond correctly
I use this header in my PHP API (altervista):
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
header("Access-Control-Allow-Origin: http://192.168.1.22:8100");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
Thank you all.
1 post - 1 participant