简体   繁体   English

Woocommerce中没有“ Access-Control-Allow-Origin”标头

[英]No 'Access-Control-Allow-Origin' header in Woocommerce

I am trying to use Woocommerce API for my mobile application but I am getting the following error. 我正在尝试为我的移动应用程序使用Woocommerce API,但出现以下错误。

XMLHttpRequest cannot load https://www.weburl.com/wc-api/v3/?consumer_key=ck_ckcomeshere&consumer_secret=cs_cscomeshere. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.1.105:8100' is therefore not allowed access.

How do I resolve this problem. 我该如何解决此问题。 Any help is highly appreciated. 非常感谢您的帮助。

Although not highly secure but this did the trick. 虽然不是很安全,但这确实成功了。 Add the following line to your .htaccess or your apache.conf file. apache.conf下行添加到您的.htaccessapache.conf文件中。

Header set Access-Control-Allow-Origin "*"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM