密钥列表与REST API的JSON响应不同

时间:2018-05-24 10:15:09

标签: python json request servicenow servicenow-rest-api

我使用requests库从REST API获取JSON响应。我的代码:

response = requests.get(url, params=payload, auth=(user, pwd), headers=headers )
data = response.json()
with open(completeName, 'w+') as fd:
    json.dump(data, fd, indent=4)

JSON文件内容:

"records":[
{
    "parent":"",
     "caused_by":"",
    "watch_list":"",
    "u_closure_code":""
}, 
 {
    "parent":"",
    "caused_by":"",
    "watch_list":""
}
]

键列表在某些响应中有所不同。有什么线索的原因?

0 个答案:

没有答案