http - 如何将参数从表单模板传递给请求
问题描述
我想next
在提交表单时向请求传递额外的参数(它应该是端点)。我试过了:
<form method="post" action="" next="/apply">
但它不起作用。稍后收到表格时,我只需要从request.args
. 如何正确执行?
解决方案
您可以使用隐藏的表单域。
<form method="post" action="">
<input type="hidden" name="next" value="/apply">
<!-- the rest of your form code -->
在您的 Flask 函数中:
next = request.form.get('next')
推荐阅读
- algorithm - 编译器设计的算法?
- excel - VBA Excel 表格范围和超链接
- c - 在 Dev-C++ 中,为什么我导入了项目所需的文件却无法编译我的项目?
- java - Java:从作为参数传递的接口创建匿名类
- php - 如何在 Macbook 上安装 Freetype 扩展
- javascript - 使用 Webpack 的条件需要/导入
- anylogic - 创建具有不同颜色的 ID 的不同类型的托盘,并使用源块插入它们
- intellij-idea - 使用 IntelliJ 时捕获所有日志
- python - 如何在预装的 3.8.2 旁边安装 python 3.6.10
- android - 未找到挂钩“after_prepare”的脚本。在离子科尔多瓦运行android