app.route("/hello")
def hello():
headers = {
'content-type':'text/plain',
'location':'http://www.baidu.com'
}
# 使浏览器识别返回内容为字符串而不是html
response = make_response("<html></html>",301)
# 浏览器接收到301状态码之后,会在headers中寻找location以重定向
response.headers = headers
return response