每当我试图在本地测试服务器上保存从表单提交到Flask中生成的网页的HTML时,保存的页面会给出以下输出:Bad Request
The browser (or proxy) sent a request that this server could not
understand.
我可以保存我的应用程序的其他页面没有问题,它只是通过表单提交的页面。在
有问题的烧瓶url路径的片段,这是从另一个url上的表单中找到的:@app.route('/profile', methods=['GET', 'POST'])
def profile():
dist_type = request.form['district-select']
dist_num = int(request.form['district-number'])
json_data = {
'dist_type' : dist_type,
'dist_num' : dist_num
}
return render_template('profile.html', data = json_data)
HTML模板'配置文件.html'由json_数据填充:
^{pr2}$
当我用Ctrl+S将这个填充的模板保存在我的浏览器中,或者将它链接到其他站点时,我无法访问HTML,而是收到400个错误的请求