I did these to fix the problem
-
updated the .htaccess file by adding
Header set Access-Control-Allow-Origin “*” Header set Access-Control-Allow-Headers “0x-version, Content-Type, Authorization, Accept, Origin, X-Requested-With” -
Added this snippet at the beginning of my API script:
header(“Access-Control-Allow-Origin: *”); header(“Access-Control-Allow-Headers: 0x-version, Content-Type, Authorization, Accept, Origin, X-Requested-With”); header(“Access-Control-Allow-Methods: GET, POST, OPTIONS”);
but still have the same issue!