Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

deprecate scrapy.utils.http

Mikhail Korobov1130711cc116
diff --git a/scrapy/utils/http.py b/scrapy/utils/http.py
index 7cc8d1884..b6e05c862 100644
--- a/scrapy/utils/http.py
+++ b/scrapy/utils/http.py
@@ -4,8 +4,19 @@ Transitional module for moving to the w3lib library.
For new code, always import from w3lib.http instead of this module
"""
+import warnings
+
+from scrapy.exceptions import ScrapyDeprecationWarning
+from scrapy.utils.decorators import deprecated
from w3lib.http import *
+
+warnings.warn("Module `scrapy.utils.http` is deprecated, "
+ "Please import from `w3lib.http` instead.",
+ ScrapyDeprecationWarning, stacklevel=2)
+
+
+@deprecated
def decode_chunked_transfer(chunked_body):
"""Parsed body received with chunked transfer encoding, and return the
decoded body.