提交 0f6cd450 编写于 作者: 鞋子不会飞's avatar 鞋子不会飞

自定义状态码和响应头

# 5.1) 元祖方式
上级 e46cdb8a
...@@ -98,4 +98,5 @@ def demo4(): ...@@ -98,4 +98,5 @@ def demo4():
# 目的是为了和前端进行交互,定义一套自定义的交互规则 # 目的是为了和前端进行交互,定义一套自定义的交互规则
# return '状态码为 666', 666 # return '状态码为 666', 666
# return '状态码为 666', 666, [('Itcast', 'Python')] # return '状态码为 666', 666, [('Itcast', 'Python')]
# return 响应体, 状态码, 响应头
return '状态码为 666', 666, {'Itcast': 'Python'} return '状态码为 666', 666, {'Itcast': 'Python'}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册