![](https://img.haomeiwen.com/i1796993/8130395dfc94b9b4.png)
实例:文件下载
(1)HttpResponse方式:
![](https://img.haomeiwen.com/i1796993/a6bb4d7cbbb6532e.png)
(2)StreamingHttpResponse方式:
![](https://img.haomeiwen.com/i1796993/3c101982c4f5f1e2.png)
![](https://img.haomeiwen.com/i1796993/3a8fd9123625032a.png)
![](https://img.haomeiwen.com/i1796993/2936772994756d6c.png)
(3)FileResponse方式:
Content-Type用于指定文件类型
Content-Disposition用于指定下载信息的默认名称
这两个类型是MIME类型的标准定义
![](https://img.haomeiwen.com/i1796993/c0b5ba64c04e28da.png)
(1)HttpResponse方式:
(2)StreamingHttpResponse方式:
(3)FileResponse方式:
Content-Type用于指定文件类型
Content-Disposition用于指定下载信息的默认名称
这两个类型是MIME类型的标准定义
本文标题:Django的视图流式响应机制
本文链接:https://www.haomeiwen.com/subject/zkrhnxtx.html
网友评论