小编Fra*_*Yin的帖子

如何使用python wsgi应用程序读取Json对象

我需要开发一个python(v2.7)wsgi应用程序来接收和解析从另一个Web发布的json对象中的数据.

示例JSON对象的格式如下所示.

{
  "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
     }
  ]
}
Run Code Online (Sandbox Code Playgroud)

如何使用wsgi来获取(读取)"BuildId","ConfigurationId","ftp"等?谁能帮我?提前致谢!

python post json mod-wsgi python-2.7

2
推荐指数
1
解决办法
3903
查看次数

如何通过python从json数组中获取数据

我有以下 json 对象数据,我如何使用 python 来获取"BuildId"和第二个"ftp" (注意:它在 内"ArchiveLocation")值?

     {"BuildId":"4c53575f-36f48a7f1f37",
      "EventId":1,
      "ArchiveLocations":
      [
         {
            "archive_server":"CA",
            "ftp":"ftp://ABC1.com/2011_V2/2011.4.103.002",
            "dfs":"\\\\ABD\\dfs\\Department\\2011.4.103.002"
         },
         {
            "archive_server":"CT",
            "ftp":"ftp://ABC2.com/2011_V2/2011.4.103.002",
            "dfs":"\\\\ABD.com\\dfs\\Department\\2011.4.103.002"
         }
      ]

   }
Run Code Online (Sandbox Code Playgroud)

arrays json mod-wsgi python-2.7

0
推荐指数
1
解决办法
7787
查看次数

标签 统计

json ×2

mod-wsgi ×2

python-2.7 ×2

arrays ×1

post ×1

python ×1