【发布时间】:2022-01-22 13:45:37
【问题描述】:
我要发送的正文:
update_request={
"id": "f07de0a44c2911ea8fb2bc764e10b970",
"user": {
"user": "3491574055045",
"timestamp": "1640049459",
"signature": "YQvl1dWkN6MrHQ8xGwEQndVo2QdPSzc6EqLJslzNjy4%3D",
"code": "test"
}
}
这是我现在的代码:
url = "https://api.ordergroove.com/customer/update_customer"
headers = {
'content-type': 'application/json'
}
body = """
update_request={{
"id": "f07de0a44c2911ea8fb2bc764e10b970",
"user": {
"timestamp": "1640049459",
"signature": "YQvl1dWkN6MrHQ8xGwEQndVo2QdPSzc6EqLJslzNjy4%3D",
"code": "test"
}
}}
"""
#Send and print response
response = requests.post(url, data=body, headers=headers)
如果我在 Postman 中运行它,虽然它工作得很好: Postman screenshot
【问题讨论】:
-
您在此处发布的代码有什么问题...?
-
另外,他们接受非标准 JSON 作为有效的 POST 正文是什么类型的 API?
-
这似乎不适合发布...
标签: python post python-requests postman