WooCommerce - woocommerce_rest_cannot_view - Status 401

前端 未结 10 976
眼角桃花
眼角桃花 2021-01-02 00:09

I have generated a consumer key and consumer secret. The website has SSL installed. I have also installed plugins required for JSON and REST services. This is how the url lo

10条回答
  •  佛祖请我去吃肉
    2021-01-02 00:45

    Trying to help others: I was struggling with the 401 response while trying to CURL, and also with VBA trying to request as content-type "application/json" However, I was able to pull a valid response by just entering this in my browser address bar: https://mywebsite.com/wp-json/wc/v2/products?consumer_key=ck_blahblah&consumer_secret=cs_blahblah

    Following this line of thought, I went back to my VBA app and changed the content type to "application/text" and was able to pull a valid response text with response code 200. Hope this helps someone.

提交回复
热议问题