问题
I want to exchange information with BigCommerce during application installation and send POST request for code from html page. But I keep getting blocked by CORS: " No 'Access-Control-Allow-Origin' header is present on the requested resource.". And I cannot find anything about it in BigCommerce API documentation.
Do somebody know, is it supported? Is there any way to call BigCommerce api from javascript in browser?
回答1:
We do not support CORS. It is very insecure to try to call the API from javascript on in the browser directly. This exposes an API token which enables someone to have access to any data in the store available through basic authentication. This would include PII.
If you really need to call info from the API, please use a secure web service that returns very specific values to your script as opposed to calling it directly.
来源:https://stackoverflow.com/questions/35942220/does-the-bigcommerce-api-supports-cors