from flask import Flask, redirect, request # 设置static为url根目录 app = Flask(__name__, static_url_path="") # 文件上传大小 3MB app.config['MAX_CONTENT_LENGTH'] = 3 * 1024 * 1024 @app.route("/", methods=['post', 'get']) def hello(): print(request.json) # json参数 print(request.args) # param参数 return redirect("/index.html") if __name__ == '__main__': app.run()