Skip to content

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

empty bodies does not require a body producer

Daniel Grañaba6545555f1d
diff --git a/scrapy/core/downloader/handlers/http11.py b/scrapy/core/downloader/handlers/http11.py
index 1690899df..9195ba0d2 100644
--- a/scrapy/core/downloader/handlers/http11.py
+++ b/scrapy/core/downloader/handlers/http11.py
@@ -54,7 +54,7 @@ class ScrapyAgent(object):
url = urldefrag(request.url)[0]
method = request.method
headers = Headers(request.headers)
- bodyproducer = _RequestBodyProducer(request.body or '')
+ bodyproducer = _RequestBodyProducer(request.body) if request.body else None
agent = self._get_agent(request)
start_time = time()
d = agent.request(method, url, headers, bodyproducer)