May-14-2019, 12:39 PM
(May-11-2019, 02:46 AM)garnold Wrote: I understand that the u is not an issue but I can't seem to parse this information out.You get
u'something'
because you use Python 2,just stop using Python 2.Python 3 has a new Unicode system,that's much improved over Python 2.
>>> import requests >>> >>> buttonColor = 'Yellow' >>> r = requests.post('http://httpbin.org/post', json={"buttonColor":buttonColor}) >>> r.status_code 200 >>> json_data = r.json() >>> print(json_data['json']) {'buttonColor': 'Yellow'} >>> print(json_data['json']['buttonColor']) Yellow