Merge pull request #2197 from thomdixon/improve-response-documentation

[MRG+1] Correct documentation about Response parameters
This commit is contained in:
Elias Dorneles 2016-08-29 11:08:30 -03:00 committed by GitHub
commit 1e95bf59ef
1 changed files with 8 additions and 8 deletions

View File

@ -463,7 +463,7 @@ method for this job. Here's an example spider which uses it::
Response objects
================
.. class:: Response(url, [status=200, headers, body, flags])
.. class:: Response(url, [status=200, headers=None, body=b'', flags=None, request=None])
A :class:`Response` object represents an HTTP response, which is usually
downloaded (by the Downloader) and fed to the Spiders for processing.
@ -471,28 +471,28 @@ Response objects
:param url: the URL of this response
:type url: string
:param status: the HTTP status of the response. Defaults to ``200``.
:type status: integer
:param headers: the headers of this response. The dict values can be strings
(for single valued headers) or lists (for multi-valued headers).
:type headers: dict
:param status: the HTTP status of the response. Defaults to ``200``.
:type status: integer
:param body: the response body. It must be str, not unicode, unless you're
using a encoding-aware :ref:`Response subclass
<topics-request-response-ref-response-subclasses>`, such as
:class:`TextResponse`.
:type body: str
:param meta: the initial values for the :attr:`Response.meta` attribute. If
given, the dict will be shallow copied.
:type meta: dict
:param flags: is a list containing the initial values for the
:attr:`Response.flags` attribute. If given, the list will be shallow
copied.
:type flags: list
:param request: the initial value of the :attr:`Response.request` attribute.
This represents the :class:`Request` that generated this response.
:type request: :class:`Request` object
.. attribute:: Response.url
A string containing the URL of the response.