Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Https request and CORS error

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>