diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index b3d0f76a7e..347f9c15bb 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -40,9 +40,10 @@ All attributes should be considered read-only, unless stated otherwise. The raw HTTP request body as a byte string. This is useful for processing data in different ways than conventional HTML forms: binary images, - XML payload etc. For processing conventional form data, use ``HttpRequest.POST``. + XML payload etc. For processing conventional form data, use + :attr:`HttpRequest.POST`. - You can also read from an HttpRequest using a file-like interface. See + You can also read from an ``HttpRequest`` using a file-like interface. See :meth:`HttpRequest.read()`. .. attribute:: HttpRequest.path @@ -68,7 +69,7 @@ All attributes should be considered read-only, unless stated otherwise. .. attribute:: HttpRequest.method A string representing the HTTP method used in the request. This is - guaranteed to be uppercase. Example:: + guaranteed to be uppercase. For example:: if request.method == 'GET': do_something() @@ -81,8 +82,9 @@ All attributes should be considered read-only, unless stated otherwise. data (or ``None``, which means the :setting:`DEFAULT_CHARSET` setting is used). You can write to this attribute to change the encoding used when accessing the form data. Any subsequent attribute accesses (such as reading - from ``GET`` or ``POST``) will use the new ``encoding`` value. Useful if - you know the form data is not in the :setting:`DEFAULT_CHARSET` encoding. + from :attr:`GET` or :attr:`POST`) will use the new ``encoding`` value. + Useful if you know the form data is not in the :setting:`DEFAULT_CHARSET` + encoding. .. attribute:: HttpRequest.content_type @@ -115,14 +117,13 @@ All attributes should be considered read-only, unless stated otherwise. dictionary -- if, say, a form is requested via the POST HTTP method but does not include form data. Therefore, you shouldn't use ``if request.POST`` to check for use of the POST method; instead, use ``if request.method == - "POST"`` (see above). + "POST"`` (see :attr:`HttpRequest.method`). - Note: ``POST`` does *not* include file-upload information. See ``FILES``. + ``POST`` does *not* include file-upload information. See :attr:`FILES`. .. attribute:: HttpRequest.COOKIES - A standard Python dictionary containing all cookies. Keys and values are - strings. + A dictionary containing all cookies. Keys and values are strings. .. attribute:: HttpRequest.FILES @@ -132,16 +133,14 @@ All attributes should be considered read-only, unless stated otherwise. See :doc:`/topics/files` for more information. - Note that ``FILES`` will only contain data if the request method was POST - and the ``