diff options
| author | Fred Drake <fdrake@acm.org> | 2000-11-17 18:04:03 +0000 |
|---|---|---|
| committer | Fred Drake <fdrake@acm.org> | 2000-11-17 18:04:03 +0000 |
| commit | f42eedd47a50386d49a029041d7478b75306af55 (patch) | |
| tree | b6e67719798a8e6b92730b88fd1c43dd026155bc /Doc/lib/libhttplib.tex | |
| parent | 09c1963a87606d39368be78d63ec4f35132227f3 (diff) | |
| download | cpython-f42eedd47a50386d49a029041d7478b75306af55.tar.gz | |
Fixed typos and bug in the second example, reported by Scott Schram
<schram@users.sourceforge.net>.
This closes bug #122236.
Diffstat (limited to 'Doc/lib/libhttplib.tex')
| -rw-r--r-- | Doc/lib/libhttplib.tex | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/lib/libhttplib.tex b/Doc/lib/libhttplib.tex index 1d09766d39..984cc6d9a8 100644 --- a/Doc/lib/libhttplib.tex +++ b/Doc/lib/libhttplib.tex @@ -137,12 +137,13 @@ Here is an example session that shows how to \samp{POST} requests: >>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) >>> h = httplib.HTTP("www.musi-cal.com:80") >>> h.putrequest("POST", "/cgi-bin/query") +>>> h.putheader("Content-type", "application/x-www-form-urlencoded") >>> h.putheader("Content-length", "%d" % len(params)) >>> h.putheader('Accept', 'text/plain') >>> h.putheader('Host', 'www.musi-cal.com') >>> h.endheaders() ->>> h.send(paramstring) +>>> h.send(params) >>> reply, msg, hdrs = h.getreply() ->>> print errcode # should be 200 +>>> print reply # should be 200 >>> data = h.getfile().read() # get the raw HTML \end{verbatim} |
