Parse POST HTTP response using Python
Question: i want to parse a 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 to parse the - "SessionID" to a 2nd http request. How can i achieve it?
Thanks !


Answer: 
    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 you are using urllib, I recommend using [requests](http://docs.python-
requests.org/en/master/)

