flask使用get请求传递参数
作者:互联网
#后端程序
from flask import Flask,request app = Flask(__name__) @app.route('/loginsss') def hello_world(): numb = int(request.args.get('numb')) numb += 1 return str(numb) if __name__ == '__main__': app.run()
#前段程序
import requests url = 'http://127.0.0.1:5000/loginsss' params = { 'numb':'4', } res = requests.get(url=url,params=params) print(res.text)
标签:__,请求,get,flask,app,url,params,numb 来源: https://blog.csdn.net/qq_44862918/article/details/91041383