码迷,mamicode.com
首页 > 编程语言 > 详细

Python之requests错误Expecting value: line 1 column 1 (char 0)

时间:2020-07-12 00:57:06      阅读:521      评论:0      收藏:0      [点我收藏+]

标签:ring   json   char   错误   interface   orm   self   query   org   

修复前
self.r =requests.post(url,params=params,headers=headers,timeout=Interface_Time_Out)
修复后
self.r =requests.post(url,data=params,headers=headers,timeout=Interface_Time_Out)
原因
http://httpbin.org/get?key1=value1&key2=value2

params关键字代表的是query string(从字符“?”开始的就是query string)

data关键字代表的是body中的form

json关键字代表的是body中的json

Python之requests错误Expecting value: line 1 column 1 (char 0)

标签:ring   json   char   错误   interface   orm   self   query   org   

原文地址:https://www.cnblogs.com/PMXGG/p/13286018.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!