calatonsystems / wc-api-java

Java wrapper for WooCommerce REST API
MIT License
98 stars 77 forks source link

Receiving an HTTP 406 Not Acceptable #50

Closed SericonTech closed 1 year ago

SericonTech commented 1 year ago

I just started using this library an am having a problem. I have a valid WooCommerce account and created REST API credentials, but when I try to run the sample code I experienced the same error that was reported in Issue #7.

However, I dove a little bit deeper and saw what was actually being returned from the API. I get this:

HttpResponseProxy{HTTP/1.1 406 Not Acceptable [Server: nginx, Date: Tue, 12 Sep 2023 19:02:09 GMT, Content-Type: text/html, Content-Length: 156, Connection: keep-alive, X-Cache: miss, X-Rq: yyz3 ] ResponseEntityProxy{[Content-Type: text/html,Content-Length: 156,Chunked: false]}}

Not sure how this could be happeneing. I did verify that the supporting libraries seemed okay and I'm pretty sure I entered my credentials correctly.

Any ideas on what could be happening or how to get more info? Is it possible that the API changed?

SericonTech commented 1 year ago

Okay, never mind, big misunderstanding.

I set the 2 codes correctly, but failed to set the URL from woocommerce.com to my server.

I thought it was supposed to use woocommerce.com, but now it's obvious that this is wrong.