merge - Fix Issue14721: Send Content-length: 0 for empty body () in the http.client requests

This commit is contained in:
Senthil Kumaran 2012-05-19 16:58:45 +08:00
commit d34b57a9a2
3 changed files with 32 additions and 1 deletions

View file

@ -1076,7 +1076,7 @@ class HTTPConnection:
self.putrequest(method, url, **skips)
if body and ('content-length' not in header_names):
if body is not None and ('content-length' not in header_names):
self._set_content_length(body)
for hdr, value in headers.items():
self.putheader(hdr, value)