From 39e5da5f66c325bbdb3b49d79d4f02f60d52df95 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Mon, 8 Jul 2013 19:17:29 +0600 Subject: [PATCH] improve docs for DownloaderMiddleware.process_response --- docs/topics/downloader-middleware.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rst index 737ed5995..c6a189055 100644 --- a/docs/topics/downloader-middleware.rst +++ b/docs/topics/downloader-middleware.rst @@ -87,19 +87,20 @@ single Python class that defines one or more of the following methods: .. method:: process_response(request, response, spider) - :meth:`process_response` should return a :class:`~scrapy.http.Response` - object or raise a :exc:`~scrapy.exceptions.IgnoreRequest` exception. + :meth:`process_response` should return either a :class:`~scrapy.http.Response` + object, a :class:`~scrapy.http.Request` object or + raise a :exc:`~scrapy.exceptions.IgnoreRequest` exception. If it returns a :class:`~scrapy.http.Response` (it could be the same given response, or a brand-new one), that response will continue to be processed with the :meth:`process_response` of the next middleware in the pipeline. - If it returns an :exc:`~scrapy.exceptions.IgnoreRequest` exception, the - response will be dropped completely and its callback never called. - If it returns a :class:`~scrapy.http.Request` object, the returned request will be rescheduled to be downloaded in the future. + If it returns an :exc:`~scrapy.exceptions.IgnoreRequest` exception, the + response will be dropped completely and its callback never called. + :param request: the request that originated the response :type request: is a :class:`~scrapy.http.Request` object