Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

cors header ‘access-control-allow-origin’ missing IN PARTICULAR CAKEPHP API

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    exit(0);
}
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #cors #header #missing #IN #PARTICULAR #CAKEPHP #API
ADD COMMENT
Topic
Name
9+4 =