parsing - Parse POST HTTP response using Python -


i want parse post http response using python.

my response looks like:

{   "result": 0,   "responsestatus": {     "errorcode": null,     "message": null,     "stacktrace": null,     "errors": null   },   "sessionid": "68ebcd6f-0aef-420d-a12b-c953f8df8ed1",   "responseheader": {     "succeeded": true,     "errors": []   } } 

i want parse - "sessionid" 2nd http request. how can achieve it? !

import json  response = '{"result": 0, "responsestatus": { "errorcode": null,"message": null, "stacktrace": null, "errors": null },"sessionid": "68ebcd6f-0aef-420d-a12b-c953f8df8ed1", "responseheader": { "succeeded": true, "errors": [] } }' json_response = json.loads(response) print json_response['sessionid'] 

i guess using urllib, recommend using requests


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -