WooCommerce REST API“woocommerce_rest_cannot_view”

问题描述 投票:0回答:2

当我粘贴此链接时

http://localhost/wordpress/wp-json/wc/v2/products?consumer_key=ck_ *******************&CONSUMER_SECRET = CS _ ********************

它向我显示此错误消息

{“code”:“woocommerce_rest_cannot_view”,“message”:“抱歉,您无法列出资源。”,“数据”:{“状态”:401}}

顺便说一句,消费者的关键和秘密是正确的

rest api woocommerce wordpress-rest-api woocommerce-rest-api
2个回答
0
投票

401是未经授权的错误

如果密钥和密钥是正确的,它可能是SSL的待办事项

其他人报告类似的问题

https://github.com/woocommerce/woocommerce/issues/19649


0
投票

您的连接必须抛出https并将此行添加到您的woocommerce init:

{
....
      verifySsl: false,
      queryStringAuth: true
}

每个帖子请求都需要ssl

从这个链接重复qazxsw poi&qazxsw poi

© www.soinside.com 2019 - 2024. All rights reserved.