【发布时间】:2017-02-23 14:59:42
【问题描述】:
我在 Woocommerce Rest Api 上收到 401 错误
- Woocommerce 最新版本
- WP 调试已禁用
- Nginx 服务器
- 正确验证配置(密钥)
{"code":"woocommerce_rest_authentication_error","message":"Assinatura inv\u00e1lida - a assinatura fornecida n\u00e3o confere.","data":{"status":401}}
{'x-robots-tag': 'noindex', 'x-content-type-options': 'nosniff', 'x-powered-by': 'PHP/5.5.9-1ubuntu4.17', 'transfer-encoding': 'chunked', 'access-control-expose-headers': 'X-WP-Total, X-WP-TotalPages', 'keep-alive': 'timeout=5', 'server': 'nginx', 'connection': 'keep-alive', 'link': '<http://subdomain.example.com/wp-json/>; rel="https://api.w.org/"', 'date': 'Thu, 23 Feb 2017 14:51:35 GMT', 'access-control-allow-headers': 'Authorization, Content-Type', 'content-type': 'application/json; charset=UTF-8'}
import sys
from WooCommerceClient import WooCommerceClient
import pprint
wc_client = WooCommerceClient('ck_8fe372c78d82bf65ff454f68abfe35b8d6140e9d', 'cs_52bd7c4693a26808b66edb7d1f7cad98e5cb213f', 'http://subdomain.example.com/')
pprint.pprint(wc_client.get_products())
【问题讨论】:
标签: nginx woocommerce-rest-api