发布:xyz.com/wp-json/wc/store/cart/add-item 我正在开发移动 woocommerce 应用程序并尝试在购物车中添加项目,但出现一些错误,请帮助解决此问题,谢谢。
In Body:
{
"id": "8924",
"quantity":1,
"variation": [
{
"items" :{
"attribute": "hj",
"value": "knk"
}
}
]
}
Error:
{
"code": "woocommerce_rest_missing_nonce",
"message": "Missing the X-WC-Store-API-Nonce header. This endpoint requires a valid nonce.",
"data": {
"status": 401
}
}
Run Code Online (Sandbox Code Playgroud)