首页 > 解决方案 > JSON 值无法转换为 System.Int32 python POST

问题描述

我对 python 中的 POST 方法有疑问。

我的代码:

url = "https://blablabla.com"
data = {
    "data1": "blalba",
    "data2": "12"
}

resp = requests.post(url, json=data)

print(resp.text)

我的输出是:

{"result":false,"data":null,"error":{"httpStatusCode":0,"errorMessages":null,"isError":false},"validationErrors":[{"field":"$.sicno","error":["The JSON value could not be converted to System.Int32. Path: $.sicno | LineNumber: 0 | BytePositionInLine: 18."]}],"isError":true}

我该如何处理?谢谢你。

标签: pythonjsonpython-3.xpython-requests

解决方案


推荐阅读