创建Response
from flask import Response
@app.route('/return_str')
def return_str():
return Response("你好,少年")
make_response方式
@app.route('/demo2')
def demo2():
resp = make_response('make response测试')
resp.headers['itbaizhan'] = 'Python'
resp.status = '404 not found'
return resp