python接口请求 JSON parse error: Unrecognized token ‘accountsId‘: was expecting
报错原因:
传参错误,协议头信息中需要传json数据请求头,headers = {‘Content-Type’: ‘application/json’}
解决办法:
先查看参数类型:print(type(data))
做下类型转换:data1=json.dumps(data)
response = requests.post(url, data=data1, headers=headers)
原文链接:https://blog.csdn.net/llg___/article/details/124734998