mercredi 8 août 2018

Woo Commerce API error

I am a newbie to Web and Ionic development. I am making an e-commerce app using Ionic and Woo-Commerce as a back end. I use the browser to test my app. I have tried my first API request and tried loading the products.

this.WooCommerce.getAsync("products").then((data) => {
  console.log(data);
},(err) => {
  console.log(err);
})

This is the error I get in the console.

Failed to load http://www.testsite1234.website/wc-api/v3/products?oauth_consumer_key=ck_9e0a187f1d5333868e5e55e79ac53872874600e6&oauth_nonce=yHUbYoVs95mU9ZixLZpPtdsUCKSKTFAl&oauth_signature_method=HMAC-SHA256&oauth_timestamp=1533777564&oauth_version=1.0&oauth_signature=Ek6994zjNunTk5pd3RT9IXsl%2FIlfT2JNtV94RBETVM8%3D: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8101' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I tried making new API keys but I don't seem to have any luck. Please shed some light on this error anyone. Thank you in advance.




Aucun commentaire:

Enregistrer un commentaire