简体   繁体   中英

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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