操作文件
1
| pip install flask -i https://mirrors.aliyun.com/pypi/simple/
|
执行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| from flask import Flask,request app = Flask(__name__)
@app.route('/api/testPost', methods=['Get']) def testPost(): param = request.args print("打印所有的参数:" + str(param)) userName = request.args.get('username') userPassword = request.args.get('password') if (userName == '1') & (userPassword == '1'): return "登录成功" else: return "登录失败" if __name__ == '__main__': app.run(port=8888)
|
测试
本文地址: https://github.com/maxzhao-it/blog/post/9bf163e/