why woocommerce REST api is returning empty value
-
We updated the woo commerce plugin latest version as 3.4 in local and test server.
Woo Rest API is not getting value properly. It is getting an empty value.
when we print the JSON value and it is getting below error in woo commerce.
ex:
res=wcapi.get(“orders/18647”)
print res.json()raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decodedCode:
wcapi = API( url="https://www.example.com/", consumer_key="xxxx", consumer_secret="yyyy", wp_api=True, version="wc/v2", query_string_auth= True, )
if(wcapi): print(wcapi) res=wcapi.get("") print res print res.status_code print res.headers['content-type'] if(res.text==""): print "Empty data " else: print res.text
Output:
<woocommerce.api.API object at 0x7f27860e66d0>
<Response [200]>
200
application/json; charset=UTF-8
Empty data
2.7.12- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘why woocommerce REST api is returning empty value’ is closed to new replies.