summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2011-12-17 03:53:25 +0000
committerAdrian Holovaty <adrian@holovaty.com>2011-12-17 03:53:25 +0000
commit8767439af45d94025210ea13d0d4be465553b855 (patch)
tree50be83ef34865478e183c7b1277a3c4bffc7c308 /docs/ref
parentd3055b3382363163c3352347e69c47f58c3d49a1 (diff)
Converted some of the built-in views to use content_type instead of mimetype HttpResponse argument. Refs #16519
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/request-response.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 302a061089..4bbfac4b55 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -538,7 +538,7 @@ Typical usage is to pass the contents of the page, as a string, to the
>>> from django.http import HttpResponse
>>> response = HttpResponse("Here's the text of the Web page.")
- >>> response = HttpResponse("Text only, please.", mimetype="text/plain")
+ >>> response = HttpResponse("Text only, please.", content_type="text/plain")
But if you want to add content incrementally, you can use ``response`` as a
file-like object::
@@ -577,10 +577,10 @@ Telling the browser to treat the response as a file attachment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To tell the browser to treat the response as a file attachment, use the
-``mimetype`` argument and set the ``Content-Disposition`` header. For example,
+``content_type`` argument and set the ``Content-Disposition`` header. For example,
this is how you might return a Microsoft Excel spreadsheet::
- >>> response = HttpResponse(my_data, mimetype='application/vnd.ms-excel')
+ >>> response = HttpResponse(my_data, content_type='application/vnd.ms-excel')
>>> response['Content-Disposition'] = 'attachment; filename=foo.xls'
There's nothing Django-specific about the ``Content-Disposition`` header, but