From: Fred Drake Date: Fri, 17 Nov 2000 18:04:03 +0000 (+0000) Subject: Fixed typos and bug in the second example, reported by Scott Schram X-Git-Tag: v2.1a1~732 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d99e534de6ecca7e65d293626539499515818a0b;p=thirdparty%2FPython%2Fcpython.git Fixed typos and bug in the second example, reported by Scott Schram . This closes bug #122236. --- diff --git a/Doc/lib/libhttplib.tex b/Doc/lib/libhttplib.tex index 1d09766d39d7..984cc6d9a85f 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}