当前位置:   article > 正文

flask——post请求无法访问页面_flask 接受不到post

flask 接受不到post

一、问题描述

  1. 代码
# post测试
@app.route('/postTest', methods=['post']) 
def postTest():
    return "567"
  • 1
  • 2
  • 3
  • 4
  1. 出错:Method Not Allowed The method is not allowed for the requested URL.
    在这里插入图片描述
    在这里插入图片描述
  2. 解决:methods增加一个get
# post测试
@app.route('/postTest', methods=['get','post'])
def postTest():
    return "567"
  • 1
  • 2
  • 3
  • 4
  1. 原因:
  • 不太清楚,感觉这样还是没有解决问题的根本>_<
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/46851
推荐阅读
相关标签
  

闽ICP备14008679号