Woocommerce No JSON object could be decoded error
-
When we print the JSON value and it is getting below error in woo commerce as No JSON object could be decoded. Any one suggest good answer.
Code:
wcapi = API( url="https://www.example.com/", consumer_key="xxxx", consumer_secret="yyyy", wp_api=True, version="wc/v2", query_string_auth= True, )
While running the below code
pprint(wcapi.get(""))
It getting <Response [200]>.
pprint(wcapi.get("orders/19895").json())
Error:
Traceback (most recent call last):
File “test.py”, line 41, in <module>
pprint(wcapi.get(“orders/19895”).json())
File “/home/harmony/virt/10.0-LS/local/lib/python2.7/site-packages/requests/models.py”, line 826, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python2.7/json/__init__.py”, line 339, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python2.7/json/decoder.py”, line 382, in raw_decode
raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decoded
- The topic ‘Woocommerce No JSON object could be decoded error’ is closed to new replies.