I want to convert HTTP GET response (I am using requests library) to python object. Here's my code:
# Full, pure, response
response = requests.get(url)
# Getting request data/content represented in byte array
content = response.content
# Byte array to string
data = content.decode('utf8')
# This line causes "ValueError: malformed node or string: <_ast.Name object at 0x7f35068be128>"
#data = ast.literal_eval(data)
# I tried this also but data is still string after those 2 lines
data = json.dumps(data)
data = json.loads(data, object_hook=lambda d: namedtuple('X', d.keys())(*d.values()))
content = response.json()?response.textlooks like, if it is a valid json object, then only you can performdumpsorloadson it @DolidodTeethtard