服务器希望我的有效负载看起来像这样:
{"fields":[
{"name":"name","data":"leslie"},
{"name":"email","data":"leslie@somewhere"},
{"name":"phone","data":"555-555-5555"}]}
如何写一个有效载荷像这样?
嗨。 我无法写入有效载荷。import requests
import json
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
'content-type': 'application/json',
'platform': 'web',
'accept-encoding': 'gzip'}
payload = ?????
r = requests.post(url, data=json.dumps(payload) ,headers=headers)