Flask - POST - The method is not allowed for the requested URL Flask - POST - The method is not allowed for the requested URL flask flask

Flask - POST - The method is not allowed for the requested URL


You gotta add "POST" in the route declaration accepted methods. You've put it in the function.

@app.route('/test', methods=['GET', 'POST'])def test():    if request.method=='GET':        return('<form action="/test" method="post"><input type="submit" value="Send" /></form>')    elif request.method=='POST':        return "OK this is a post method"    else:        return("ok")

See : http://flask.pocoo.org/docs/0.10/quickstart/