Closed ChrisDubois36 closed 5 years ago
Did you work out the error? I'm getting the exact same issue, the error message isn't very helpful.
Any progress about this error?
This is a very depressing and generic error. I am getting this problem when I use a specific endpoint. However, when I use an experimental endpoint the API is working fine.
I did work it out in the end, something to do with API settings on WordPress. I think it was how Wordpreess was returning the results or something.
I actually need to work on this again tomorrow to setup another WooCommerce customer on our platform so I will figure it out again and let you guys know.
Any Updates on the issue? I do get the same error. I am not using the localhost, but an own development domain on mamp pro. but I do work with the https-protocol.
I think all I did to fix this issue was to change the permalinks option to "Post Name" within WordPress. In fact, this is crucial otherwise it won't work as per the WooCommerce Api documentation here: https://woocommerce.github.io/woocommerce-rest-api-docs/v3.html#version
You can test this by going to (after logging into WP-Admin) https://wordpressite.com/wp-json/wp/v2/posts If you get an error, then your permalinks are not setup correctly.
Also, under "WooCommerce" > "Settings" > "Advanced" > "Legacy API", I have this enabled.
this error comes from your server, there is a syntax error in the JSON response. This could be generated by your theme, plugins or custom code, also as reported, maybe permalinks needing to be updated again for some bug, still this is not an issue with this REST API library, so I'm closing.
Print de body response on HttpClient:processResponse() on line 366, print that result and see what's the response of the request. In my case was a garbage text of notice and warning because I have the debug mode active. I hope that helps someone with that trick to find the error.
Hello, im pretty newbie working on API REST and i have an issue when making a simple get request on products with Syntax Error like this :
Here is my code for the request, please help me i don't know where is the problem