skip to Main Content

I am working on configuring my Woocommerce + React app and am running into a 401 unauthorized error when making a POST request. I am able to successfully retrieve data with a GET request, but am struggling with POSTs.

console

This is my first project with Woocommerce and React and I am working on localhost using XAMPP to run WordPress. I’m using Windows 11 as my operating system. Any help would be greatly appreciated. If more information or screenshots are needed, please let me know. Thank you.

2

Answers


  1. Chosen as BEST ANSWER

    here are the "solution" that i applied but i still with 401 error

    instance OAuth1.0a instacia oauth1.0a POST method método POST Data for new product data para un producto nuevo Usage of POST method usando el método post I get on console console error


  2. Possible causes that I’ve thought of:

    1. Your XAMPP is running on HTTP and not HTTPS.
      If this is the case, then you should be able to follow the instructions in the documentation for doing HTTP "one-legged" authentication: https://woocommerce.github.io/woocommerce-rest-api-docs/?javascript#authentication-over-http
    2. You’re using a read-only API key instead of a read/write API key. (unlikely, but worth checking)
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search