zoukankan      html  css  js  c++  java
  • Flask路由报错:raise FormDataRoutingRedirect(request)

      raise FormDataRoutingRedirect(request)
    FormDataRoutingRedirect: A request was sent to this URL (http://127.0.0.1:5000/resource/vender) but a redirect was issued automatically by the routing system to "http://127.0.0.1:5000/resource/vender/".  The URL was defined with a trailing slash so Flask will automatically redirect to the URL with the trailing slash if it was accessed without one.  Make sure to directly send your POST-request to this URL since we can't make browsers or HTTP clients redirect with form data reliably or without user interaction.

    又写了一个BUG,路由配的不仔细

    按照这个写法,我们匹配的路由应该为"http://127.0.0.1:5000/resource/vender/".

    但是接口里

    我们却访问的这个,导致发生错误,所以以后斜杠一定要注意

    也可以在写路由时,加上一个参数strict_slashes=False,这个匹配时,就会对末尾的/不严格区分,有无均能匹配成功

  • 相关阅读:
    Change MYSQL data directory
    Docker distrubution in django
    mongo&node
    理解Docker单机容器网络
    auto dock
    django_restframework_angularjs
    Javascript异步编程的4种方法
    DockerProblem
    Javascript面向对象编程
    scrapy post请求 multipart/form-data
  • 原文地址:https://www.cnblogs.com/huchong/p/8818910.html
Copyright © 2011-2022 走看看