Django Book 翻译
菜单>:
TOC
返回
原文:
The key to returning non-HTML content from a view lies in the ``HttpResponse`` class, specifically the ``mimetype`` constructor argument. By tweaking the MIME type, we can indicate to the browser that weve returned a response of a different format.
翻译:
从一个视图返回一个非 HTML 内容的关键是在构造一个 ``HttpResponse`` 类时,需要指定 ``mimetype`` 参数。通过改变 MIME 类型,我们可以告知浏览器将要返回的数据是另一种不同的类型。
备注:
译者: