diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2013-03-13 20:43:23 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2013-03-13 20:43:23 (GMT) |
commit | 1428e1335f42894f70bd0424f9faaabc394690a5 (patch) | |
tree | d60a2faee73f326f3c81e6219654bbac6513e16e /Doc/library/urllib.request.rst | |
parent | 7701e6ef93be47b6d9646321ff95530653097d68 (diff) | |
parent | e66cc8172d604e07a6fcdc9cdeeb985b68c99583 (diff) | |
download | cpython-1428e1335f42894f70bd0424f9faaabc394690a5.zip cpython-1428e1335f42894f70bd0424f9faaabc394690a5.tar.gz cpython-1428e1335f42894f70bd0424f9faaabc394690a5.tar.bz2 |
#17307 - merge from 3.3
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r-- | Doc/library/urllib.request.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index d30d717..16efdf1 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -1141,6 +1141,15 @@ The code for the sample CGI used in the above example is:: data = sys.stdin.read() print('Content-type: text-plain\n\nGot Data: "%s"' % data) +Here is an example of doing a ``PUT`` request using :class:`Request`:: + + import urllib.request + DATA=b'some data' + req = urllib.request.Request(url='http://localhost:8080', data=DATA,method='PUT') + f = urllib.request.urlopen(req) + print(f.status) + print(f.reason) + Use of Basic HTTP Authentication:: import urllib.request |