diff options
| author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-01-09 20:27:16 (GMT) |
|---|---|---|
| committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-01-09 20:27:16 (GMT) |
| commit | 84040dbe8170864ba673321ec7568974bdabf5a4 (patch) | |
| tree | fb2b37c85ed17cdc154d05407ec65fd500ab32ea /Lib/urllib.py | |
| parent | 7e876f5e931b92e6becb08033a8980cb31fb2e8e (diff) | |
| download | cpython-84040dbe8170864ba673321ec7568974bdabf5a4.zip cpython-84040dbe8170864ba673321ec7568974bdabf5a4.tar.gz cpython-84040dbe8170864ba673321ec7568974bdabf5a4.tar.bz2 | |
Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required.
Diffstat (limited to 'Lib/urllib.py')
| -rw-r--r-- | Lib/urllib.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 38c5ee4..d23d070 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -335,9 +335,7 @@ class URLopener: if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) - h.endheaders() - if data is not None: - h.send(data) + h.endheaders(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == -1: @@ -430,9 +428,7 @@ class URLopener: if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) - h.endheaders() - if data is not None: - h.send(data) + h.endheaders(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == -1: |
