06.response
[toc]{type: “ol”, level: [2, 3, 4, 5]}
响应对象方法
# 响应对象
# 响应相关信息
return "字符串"
return render_template('html模板路径',**{})
return redirect('/index.html')
# 对应django --> JsonResponse
return jsonify({'k1':'v1'})
aa = 'hello world'
# 包装后设置cookie
# response是flask.wrappers.Response的对象
response = make_response(aa)
response.set_cookie('xxx','lqz')
# 往响应头中放东西
response.headers['X-Something'] = 'A value'
return res