I need to develop a python (v2.7) wsgi application to receive and parse data in json object posted from another web.
The format of an example JSON object is as below.
{
"BuildId":"4c53575f-36f48a7f1f37",
"EventId":1,
"EventName":"Archiving Complete",
"EventDescription":"Fired each time the build products finish unzipping on an archive server after a successful build.",
"ConfigurationId":2021,
[
{
"archive_server":"CA",
"ftp":"ftp://ABC.com/2011_V2/ccoderre_build_dev_build/2011.4.103.002",
"dfs":"\\\\ABD.com\\ccoderre_build_dev_build\\2011.4.103.002"
}
],
"Changelists":
[
{
"author":"mike",
"description":"integrating from mainline\n",
"number":1233242,
"status":"OK",
"submit_time":"\/Date(1305844615000)\/"
}
],
"InheritedChangelists":[],
"CustomEventInfo":
[
{
"Key":"ArchiveServer",
"Value":"buildfsct"
},
{
"Key":"HasSymbols",
"Value":0
}
]
}
How can I use wsgi to get (read) “BuildId”, “ConfigurationId”, “ftp”, etc?
Can anyone help me? Thanks in advance!
Use the stdlib
jsonlibrary to parse the data, the result is a python dictionary: