empty bodies does not require a body producer

This commit is contained in:
Daniel Graña 2012-05-16 12:24:24 -03:00
parent db232da068
commit ba6545555f
1 changed files with 1 additions and 1 deletions

View File

@ -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)