好重定向, 我有上点击POST方法瓶不上POST方法
<button class="btn btn-lg btn-primary btn-block" onclick="$.post('/test',{'test':'tset'})">Home</button>
和瓶的应用程序,其中包含此代码按下按钮
@app.route('/')
def index():
return render_template("index.html")
@app.route('/test', methods=['POST'])
def test():
return redirect(url_for('index'))
没有happend一个按钮。我需要你的帮助。
onclick帖子实际上是否正在发射? 检查您的网络登录开发人员工具,以了解发生了什么请求。 –
@davidcako是啊,如果我添加打印(“POST”)在app.py,它的工作原理 –
也许这是因为POST?我不知道如何修复它 –