get请求获取URL中参数

app.py

# coding:utf-8
from flask import Flask,request,redirect,render_template
from flask import url_for
from markupsafe import escape
import json

app = Flask(__name__)
@app.route('/path/')
def get_path():
    name=request.args.get('name')
    age=request.args.get('age')

    return f"获取地址参数:{name},{age}"


if __name__ == '__main__':
    app.run(host='127.0.0.1',port=8080,debug=True)

login.html




    
    登录


忘记密码?

返回结果


image.png

你可能感兴趣的:(get请求获取URL中参数)