Python Flask-不是POST方法

Here is my code: https://repl.it/@hg0428/PYOS POST method will not work. I can not tell if buttons are pressed. I have no idea what is wrong I have tried everything.

评论
nerror
nerror

您通过定义函数方法= ['GET','POST']忘记了这一点

@app.route('/<string:user>/home', methods = ['GET', 'POST'])
def index(user):
    if request.method == 'POST':
        .......
    else:
     #METHOD GET
点赞
评论