【发布时间】:2021-07-28 21:53:58
【问题描述】:
我需要将数据发送到接受这种格式的 REST API
{'myattributes':
[{'a': {},
'v': {},
'c': {},
'd': {},
'e': {},
'f': {},
'g': {},
'h': {}}]}
我正在从数据框中读取文件,如何将数据框映射到所需的 json 格式?
url = 'https://cyz.com/hello
response = requests.post(url, json=s, headers=head)
print(response)
print(response.json())
【问题讨论】:
标签: json dataframe api dictionary