Jan-09-2020, 07:49 PM
Requests as you use has build in JSON decoder.
So then there is no need for separate module like simplejson or json(standard library).
So this should work.
So then there is no need for separate module like simplejson or json(standard library).
So this should work.
data = clients_service_response.json() print(data['id'])Demo.
>>> import requests >>> >>> my_id = '999' >>> r = requests.post('http://httpbin.org/post', json={"id": my_id}) >>> r.status_code 200 >>> data = r.json() >>> data['json']['id'] '999'