No ‘Access-Control-Allow-Origin’ header is present on the requested resource

4.91K viewsrest api

This is CORS problem.

#Add these lines to your .htaccess file
Header set Access-Control-Allow-Origin "localhost"
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Header set Access-Control-Allow-Headers "X-Oc-Merchant-Language, X-Oc-Store-Id, Content-Type,X-Oc-Merchant-Id, X-Oc-Session"
Header set Access-Control-Allow-Credentials: true
RewriteRule .* - [E=HTTP_Authorization:%{HTTP:Authorization}]
edited answer
You are viewing 1 out of 1 answers, click here to view all answers.