python中发送post请求时,报错“Unrecognized token 'xxxx': was expecting ('true', 'false' or 'null')”

时间:2018-11-07 14:06:11   收藏:0   阅读:1500

解决办法:

如请求参数为 data={“user”=“aaa”,“pwd”=“123456”,sign=“00000000000000”}

需要将参数data先做处理,调用函数datas=datajson.dumps(datas,separators=(‘,‘,‘:‘));

然后在发送post请求request.post(url,datas,.....)

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!