【发布时间】:2017-09-10 14:38:52
【问题描述】:
我正在尝试使用 javascript 代码从我的 WooCommerce 商店中检索产品。
这样做:
var result = OAuthSimple().sign({
path:'http://www.********.com/wp-json/wc/v1/products/',
parameters: {encodeSignature: true},
signatures: {
consumer_key:'ck_fcf30797c*******',
shared_secret:'cs_f4866d5d**********'
}
});
location.href=result.signed_url;
我明白了:
{"code":"woocommerce_rest_authentication_error","message":"Invalid signature - the given signature does not match.","data":{"status":401}}
OAuthSimple 代码从这里获取:http://unitedheroes.net/OAuthSimple/
请帮忙!谢谢
【问题讨论】:
标签: javascript jquery wordpress oauth woocommerce