Answers for "get method in py flask"

0

get method in py flask

from flask import *  
app = Flask(__name__)  
  
  
@app.route('/login',methods = ['GET'])  
def login():  
      uname=request.args.get('uname')  
      passwrd=request.args.get('pass')  
      if uname=="ayush" and passwrd=="google":  
          return "Welcome %s" %uname  
   
if __name__ == '__main__':  
   app.run(debug = True)  
    
# query
# GET: http://localhost:8080/login?uname=ayush&pass=google
Posted by: Guest on June-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language