from flask import Flask, request app = Flask(__name__) @app.route("/login", methods=["POST"]) def login(): username = request.form["username"] password = request.form["password"] # do something with the username and password return "Login successful" if __name__ == "__main__": app.run()