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

3.68K viewsrest api
0

This is CORS problem. http://enable-cors.org/

#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