diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2013-03-13 20:42:47 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2013-03-13 20:42:47 (GMT) |
commit | e66cc8172d604e07a6fcdc9cdeeb985b68c99583 (patch) | |
tree | 420e9a6ff98a33351fd649d450af0aa199c68aa5 /Doc/library/urllib.request.rst | |
parent | 115309acec0dfb387f96cad914a554342a897e4a (diff) | |
parent | b5fe2479c152c635e02897a7a5c72c97e4c22b6a (diff) | |
download | cpython-e66cc8172d604e07a6fcdc9cdeeb985b68c99583.zip cpython-e66cc8172d604e07a6fcdc9cdeeb985b68c99583.tar.gz cpython-e66cc8172d604e07a6fcdc9cdeeb985b68c99583.tar.bz2 |
#17307 - merge from 3.2
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 505f738..2cf1304 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -1109,6 +1109,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 |