flask的响应对象


响应对象不进行设置,返回字符串浏览器会自动把它变成html格式

1、主要响应的类型 Content-Type

  文本:text/plain

  HTML:text/html

  XML:application/xml

  json:application/json

2、手动修改响应状态码和server类型

 

 3、实现原理 make_response

  -- current_app.make_response(args)的实现

  -- Response()类

  

 4、abort异常处理方式,推荐使用