“message“: “The browser (or proxy) sent a request that this server could not understand.“ 已处理

编程入门 行业动态 更新时间:2024-10-26 20:28:43

“message“: “The browser (or <a href=https://www.elefans.com/category/jswz/34/1765361.html style=proxy) sent a request that this server could not understand.“ 已处理"/>

“message“: “The browser (or proxy) sent a request that this server could not understand.“ 已处理

文章目录

  • 1、项目场景:
  • 2、问题描述
    • 这是我练习的源码:
  • 3、原因分析:
  • 4、解决方案:

1、项目场景:

  • 在学习flask-restful的restful的参数校验时,在postman进行接口测试时报错
  • 错误:(服务器无法请求浏览器提供的数据)

2、问题描述

这是我练习的源码:

def post(self):# 步骤一:创建请求参数校验的对象rq=reqparse.RequestParser()#步骤二:定义参数的校验声明rq.add_argument('a',type=int,required=True,)#步骤三:启动校验rep=rq.parse_args()#步骤四:校验完成之后得到参数的值a=rep.areturn {'post':'hello xiaoyang','a':a}

#步骤三:把资源加载到api中,才能对外发布
api.add_resource(HelloResource,‘/hello’)

  1. postman请求

3.代码是没有问题的

3、原因分析:

1.自己网上查找了好多资料都没能解决问题
2. 后来经过老师的指导,发现是版本的问题


4、解决方案:

  1. 降低这些版本就可以了
# Flask==1.1.2
# Jinja2==3.0.1
# Werkzeug==2.0.1
# itsdangerous==2.0.1
# Flask-RESTful==0.3.8
  1. 到这里问题也就解决了

postman请求

更多推荐

“message“: “The browser (or proxy) sent a request that this server could not und

本文发布于:2024-03-08 20:19:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1722195.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:proxy   browser   message   understand   server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!