【http请求】required string parameter 'XXX'is not present 的几种情况

清疚 2021-08-19 23:03 440阅读 0赞

参考:https://blog.csdn.net/qq_40391559/article/details/82856868

第一个可能,就是你的content-Type设置是否正确【有些服务器会限制传入的方式】

Python requests.post方法中data与json参数区别:https://www.cnblogs.com/yanlin-10/p/9820694.html

  1. headers = {
  2. 【二选一】根据你服务器的要求选择【浏览器是可以检测到的】
  3. "content-Type": "application/json",
  4. "content-Type": "application/x-www-form-urlencoded",
  5. }

第二个可能:我上一次传入json参数的时候,中间有一个特殊的符号逗号,从浏览器复制的,导致不ok

第三个可能:如果你设置”content-Type”: “application/x-www-form-urlencoded”,那么就必须采用json格式化字符串!

发表评论

表情:
评论列表 (有 0 条评论,440人围观)

还没有评论,来说两句吧...

相关阅读