but I am unable to get data, and instead I am getting this error:
File "trade.py", line 29, in arr_val data = json.dumps(d).encode('utf-8') File "C:\Python27\lib\json\__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "C:\Python27\lib\json\encoder.py", line 201, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\Python27\lib\json\encoder.py", line 264, in iterencode return _iterencode(o, 0) File "C:\Python27\lib\json\encoder.py", line 178, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: is not JSON serializable
Tell me how to resolve this error, all I want is to fetch olhc close value from the response I am getting.
Instead of use response is an object you can get body in content.
I am currently using Python 2.7.13
and after doing
data = json.dumps(response.content)
It is showing error
AttributeError: 'dict' object has no attribute 'content'