CORS .htaccess
header set Access-Control-Allow-Origin "*"
header set Access-Control-Allow-Headers "origin,content-type,user-agent, accept, x-r$"
header set Access-Control-Allow-Methods "PUT,GET,POST,DELETE,OPTIONS,HEAD"
API请求
http://192.168.1.125/badlapur/wp-json/wc/v2/orders?oauth_consumer_key=ck_fe1859072d41b36ed511ba6a4e31de75aac16516&oauth_nonce=I7DfkcQvMIST8aKnGqSEHk2NsCKTljWs&oauth_signature_method=HMAC-SHA256&oauth_timestamp=1515179933&oauth_version=1.0&oauth_signature=Ru3%2BDd1zz1ihRqGhbeoYasbLZkzNGZqtb5I61UJi1Kw%3D
Json回复
{
"code": "woocommerce_rest_authentication_error",
"message": "Invalid signature - provided signature does not match.",
"data": {
"status": 401
}
}
我正在使用wordpress和以下插件
我激活了设置 - > JSON API-> Core&用户 我重新创建了消费者密钥&秘密
但仍然没有工作,有什么方法可以解决?
答案 0 :(得分:1)
最后,在研究了git的各种问题后,我们找到了解决方案:
我使用了第一种方法,它的工作完美无缺!