Flask路由报错:raise FormDataRoutingRedirect(request)
路由 报错 Flask request RAISE
2023-09-27 14:20:10 时间
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,这个匹配时,就会对末尾的/不严格区分,有无均能匹配成功
相关文章
- 【Vue】路由组件传参(Query和Params)及路由命名name的用途(图文+代码)
- 华为数通笔记-ospf路由计算
- Vue项目--尚品汇(开发流程、组件拆分,路由跳转)
- 大括号的路由意义
- vue动态路由
- react路由组件&&非路由组件
- 【摸鱼神器】一次搞定 vue3的 路由 + 菜单 + tabs
- 场景类:vue多个router-view路由嵌套
- laravel路由不生效,404,除了/ 都不行,关于nginx环境下laravel除了默认路由都出现404报错的处理方法
- vue子路由设置、全局组件、局部组件的原生写法
- vue前台(二)解决编程式路由,多次点击,报错的问题
- 教你如何建立一个安全的OSPF动态路由网络
- h3c单臂路由实验