ENDPOINT_URL = 'https://example.com'
headers = {'Api-key': '123abc'}
with open("student.csv", "r") as csv_ledger:
r = csv.DictReader(csv_ledger)
data = [dict(d) for d in r ]
groups = {}
for k, g in groupby(data, lambda r: (r['name'])):
#My data mapping
#for loop to post each record
rs = (grequests.post(u,json=groups, headers=headers) for u in ENDPOINT_URL)
grequests.map(rs)
print(grequests.map(rs)
返回的结果None
我做错了什么?难道是json数据格式问题?