diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 7f2284f..dc79097 100644
a
|
b
|
All attributes except ``session`` should be considered read-only.
|
65 | 65 | .. versionadded:: 1.0 |
66 | 66 | |
67 | 67 | A string representing the current encoding used to decode form submission |
68 | | data (or ``None``, which means the ``DEFAULT_CHARSET`` setting is used). |
69 | | You can write to this attribute to change the encoding used when accessing |
70 | | the form data. Any subsequent attribute accesses (such as reading from |
71 | | ``GET`` or ``POST``) will use the new ``encoding`` value. Useful if you |
72 | | know the form data is not in the ``DEFAULT_CHARSET`` encoding. |
| 68 | data (or ``None``, which means the :setting:`DEFAULT_CHARSET` setting is |
| 69 | used). You can write to this attribute to change the encoding used when |
| 70 | accessing the form data. Any subsequent attribute accesses (such as reading |
| 71 | from ``GET`` or ``POST``) will use the new ``encoding`` value. Useful if |
| 72 | you know the form data is not in the :setting:`DEFAULT_CHARSET` encoding. |
73 | 73 | |
74 | 74 | .. attribute:: HttpRequest.GET |
75 | 75 | |
76 | 76 | A dictionary-like object containing all given HTTP GET parameters. See the |
77 | | ``QueryDict`` documentation below. |
| 77 | :class:`QueryDict` documentation below. |
78 | 78 | |
79 | 79 | .. attribute:: HttpRequest.POST |
80 | 80 | |
81 | 81 | A dictionary-like object containing all given HTTP POST parameters. See the |
82 | | ``QueryDict`` documentation below. |
| 82 | :class:`QueryDict` documentation below. |
83 | 83 | |
84 | 84 | It's possible that a request can come in via POST with an empty ``POST`` |
85 | 85 | dictionary -- if, say, a form is requested via the POST HTTP method but |
… |
… |
All attributes except ``session`` should be considered read-only.
|
110 | 110 | |
111 | 111 | A dictionary-like object containing all uploaded files. Each key in |
112 | 112 | ``FILES`` is the ``name`` from the ``<input type="file" name="" />``. Each |
113 | | value in ``FILES`` is an ``UploadedFile`` object containing the following |
114 | | attributes: |
115 | | |
116 | | * ``read(num_bytes=None)`` -- Read a number of bytes from the file. |
117 | | * ``name`` -- The name of the uploaded file. |
118 | | * ``size`` -- The size, in bytes, of the uploaded file. |
119 | | * ``chunks(chunk_size=None)`` -- A generator that yields sequential |
120 | | chunks of data. |
| 113 | value in ``FILES`` is an :class:`UploadedFile` as described below. |
121 | 114 | |
122 | 115 | See :doc:`/topics/files` for more information. |
123 | 116 | |
… |
… |
All attributes except ``session`` should be considered read-only.
|
130 | 123 | |
131 | 124 | In previous versions of Django, ``request.FILES`` contained simple ``dict`` |
132 | 125 | objects representing uploaded files. This is no longer true -- files are |
133 | | represented by ``UploadedFile`` objects as described below. |
| 126 | represented by :class:`UploadedFile` objects. |
134 | 127 | |
135 | | These ``UploadedFile`` objects will emulate the old-style ``dict`` |
136 | | interface, but this is deprecated and will be removed in the next release of |
137 | | Django. |
| 128 | These :class:`UploadedFile` objects will emulate the old-style ``dict`` |
| 129 | interface, but this is deprecated and will be removed in the next release |
| 130 | of Django. |
138 | 131 | |
139 | 132 | .. attribute:: HttpRequest.META |
140 | 133 | |
… |
… |
All attributes except ``session`` should be considered read-only.
|
202 | 195 | |
203 | 196 | Not defined by Django itself, but will be read if other code (e.g., a custom |
204 | 197 | middleware class) sets it. When present, this will be used as the root |
205 | | URLconf for the current request, overriding the ``ROOT_URLCONF`` setting. |
206 | | See :ref:`how-django-processes-a-request` for details. |
| 198 | URLconf for the current request, overriding the :setting:`ROOT_URLCONF` |
| 199 | setting. See :ref:`how-django-processes-a-request` for details. |
207 | 200 | |
208 | 201 | Methods |
209 | 202 | ------- |
… |
… |
Methods
|
300 | 293 | process(element) |
301 | 294 | |
302 | 295 | |
| 296 | UploadedFile objects |
| 297 | ==================== |
| 298 | |
| 299 | .. class:: UploadedFile |
| 300 | |
| 301 | |
| 302 | Attributes |
| 303 | ---------- |
| 304 | |
| 305 | .. attribute:: UploadedFile.name |
| 306 | |
| 307 | The name of the uploaded file. |
| 308 | |
| 309 | .. attribute:: UploadedFile.size |
| 310 | |
| 311 | The size, in bytes, of the uploaded file. |
| 312 | |
| 313 | Methods |
| 314 | ---------- |
| 315 | |
| 316 | .. method:: UploadedFile.chunks(chunk_size=None) |
| 317 | |
| 318 | Returns generator that yields sequential chunks of data. |
| 319 | |
| 320 | .. method:: UploadedFile.read(num_bytes=None) |
| 321 | |
| 322 | Read a number of bytes from the file. |
| 323 | |
| 324 | |
| 325 | |
303 | 326 | QueryDict objects |
304 | | ----------------- |
| 327 | ================= |
305 | 328 | |
306 | 329 | .. class:: QueryDict |
307 | 330 | |
… |
… |
Django, :class:`HttpResponse` objects are your responsibility. Each view you
|
449 | 472 | write is responsible for instantiating, populating and returning an |
450 | 473 | :class:`HttpResponse`. |
451 | 474 | |
452 | | The :class:`HttpResponse` class lives in the ``django.http`` module. |
| 475 | The :class:`HttpResponse` class lives in the :mod:`django.http` module. |
453 | 476 | |
454 | 477 | Usage |
455 | 478 | ----- |
… |
… |
Methods
|
529 | 552 | .. method:: HttpResponse.__init__(content='', mimetype=None, status=200, content_type=DEFAULT_CONTENT_TYPE) |
530 | 553 | |
531 | 554 | Instantiates an ``HttpResponse`` object with the given page content (a |
532 | | string) and MIME type. The ``DEFAULT_CONTENT_TYPE`` is ``'text/html'``. |
| 555 | string) and MIME type. The :setting:`DEFAULT_CONTENT_TYPE` is |
| 556 | ``'text/html'``. |
533 | 557 | |
534 | 558 | ``content`` can be an iterator or a string. If it's an iterator, it should |
535 | 559 | return strings, and those strings will be joined together to form the |
… |
… |
Methods
|
545 | 569 | encoding, which makes it more than just a MIME type specification. |
546 | 570 | If ``mimetype`` is specified (not ``None``), that value is used. |
547 | 571 | Otherwise, ``content_type`` is used. If neither is given, the |
548 | | ``DEFAULT_CONTENT_TYPE`` setting is used. |
| 572 | :setting:`DEFAULT_CONTENT_TYPE` setting is used. |
549 | 573 | |
550 | 574 | .. method:: HttpResponse.__setitem__(header, value) |
551 | 575 | |