python-3.x - 有没有办法防止 aiohttp 将帖子表单中列表内的嵌套字典转换为字符串?
问题描述
我目前正在为一个网站编写一个 API 调用,该网站具有非常奇怪的细节,需要以下类型的表单数据:
{"somehting": "something else", "important argument": [{"specific data": "4242", "second data": 0}]}
但是当我制定请求aiohttp.ClientSession()
并使用测试发布请求时,https://httpbin.org/
我看到 aiohttp 正在向第二个字典添加一个引号,如下所示:
{"somehting": "something else", "important argument": ["{"specific data": "4242", "second data": 0}"]}
因此,当我尝试使用 api 调用时,服务器拒绝它并出现错误。
有没有办法解决这个问题或者我应该使用不同的库?
解决方案
推荐阅读
- node.js - node.js ws:如何识别哪个websocket发送了消息?
- c# - 如何设置 SOAP 网络服务
- c - CS50 PSET1 cash.c:我似乎无法让它打印出我想要的值。只是一遍又一遍地重复输入
- mysql - msqldump 文件中的数据丢失
- requirejs - 嵌套 URL 不适用于 requirejs
- python - 如何使用python查找元素并替换xml文件中同名元素的值?
- javascript - Web Material Design:MDCTopAppBar,处理动作点击
- javascript - 替换使用后如何保存部分字符串?
- objective-c - OCMock 通知观察者 - 验证对象
- python - Python:使用其他列将值分配给 Pandas 中的新列作为列表