我需要为我的get请求传递一个字典,但是当这样执行时,我得到一个编译错误:
patVect = {"poo": 0, "pin": 0, "pok": 0, "pat": 0}
# querystring = {"patients": "{\"poo\":0, \"pin\":0, \"pok\":0, \"pat\":0}"}
querystring = {"patients": patVect}
headers = {
'content-type': "application/json",
'cache-control': "no-cache",
}
response = requests.api.request('get', HURL, headers=headers, params=querystring, verify=False)
当我处理注释查询时,效果很好。知道为什么这不起作用了,或者有什么功能可以帮助你。在
可以使用Postman测试该API,可以在body部分中将
dict
参数作为原始JSON
传递。在然后,当您测试了API调用之后,就可以继续使用您的首选语言为它生成代码。在
这是
Python Requests
:这是
^{pr2}$Python http.client(Python3)
:问题是: querystring={“病人”:json.dumps文件(patVect)}
我希望这对您的请求有帮助api
相关问题 更多 >
编程相关推荐