Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

flask post vs get

@app.route("/login", methods=["POST", "GET"])
def login():
    if request.method == "POST":
        user = request.form["name"]
        return redirect(url_for("success", name=user))
    else:
        user = request.args.get("name")
        return redirect(url_for("success", name=user))
 
PREVIOUS NEXT
Tagged: #flask #post
ADD COMMENT
Topic
Name
4+5 =