数据必须是对象python请求库

response = requests.post(
    url=bid_url,
    headers={'Authorization': my_api_key},
    data={
      "type": "open",
      "initiatorId": "ecc52cc1-a3e4-4037-a80f-62d3799645f4",
      "dateCreated": datetime.now(),
      "subjectId": "8a921487-859f-4931-8743-f69c38f91b25",
      "additionalInfo": {
        "someInfo": {
          "abcd":"123",
          "efgh":"456"
        }
      }
    }
)

错误:error from the server

当我尝试运行上面的代码时,我一直收到错误'additionalInfo必须是一个对象‘。有人能帮我找出原因吗。我也尝试过传入json对象等,但仍然不起作用。当additionalInfo字段为空时,它似乎只给我一个2xx响应,如下面的代码所示

response = requests.post(
    url=bid_url,
    headers={'Authorization': my_api_key},
    data={
      "type": "open",
      "initiatorId": "ecc52cc1-a3e4-4037-a80f-62d3799645f4",
      "dateCreated": datetime.now(),
      "subjectId": "8a921487-859f-4931-8743-f69c38f91b25",
      "additionalInfo": {}
    }
)

转载请注明出处:http://www.66758680.com/article/20230526/2060773.html