diff options
author | Fred Drake <fdrake@acm.org> | 2000-08-24 01:01:26 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-08-24 01:01:26 (GMT) |
commit | 316a793a58ae91cba312bd28649bd0853b62fa0d (patch) | |
tree | 1297d363fdc82e1ca8984518cb5f984ad4fadc0f | |
parent | 8377f5debfb60b05de3b1232ec15b740c5366338 (diff) | |
download | cpython-316a793a58ae91cba312bd28649bd0853b62fa0d.zip cpython-316a793a58ae91cba312bd28649bd0853b62fa0d.tar.gz cpython-316a793a58ae91cba312bd28649bd0853b62fa0d.tar.bz2 |
Randall Hopper <aa8vb@yahoo.com>>:
Make it easier to use HTTP POST with urlretrieve().
-rw-r--r-- | Lib/urllib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index d474cfb..cdea631 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -61,11 +61,11 @@ def urlopen(url, data=None): return _urlopener.open(url) else: return _urlopener.open(url, data) -def urlretrieve(url, filename=None, reporthook=None): +def urlretrieve(url, filename=None, reporthook=None, data=None): global _urlopener if not _urlopener: _urlopener = FancyURLopener() - return _urlopener.retrieve(url, filename, reporthook) + return _urlopener.retrieve(url, filename, reporthook, data) def urlcleanup(): if _urlopener: _urlopener.cleanup() @@ -186,7 +186,7 @@ class URLopener: return url2pathname(splithost(url1)[1]), hdrs except IOError, msg: pass - fp = self.open(url) + fp = self.open(url, data) headers = fp.info() if not filename: import tempfile |