From 8767439af45d94025210ea13d0d4be465553b855 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 17 Dec 2011 03:53:25 +0000 Subject: 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 --- docs/ref/request-response.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') 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 -- cgit v1.3