]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed typos and bug in the second example, reported by Scott Schram
authorFred Drake <fdrake@acm.org>
Fri, 17 Nov 2000 18:04:03 +0000 (18:04 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 17 Nov 2000 18:04:03 +0000 (18:04 +0000)
<schram@users.sourceforge.net>.

This closes bug #122236.

Doc/lib/libhttplib.tex

index 1d09766d39d72a28c3b3615ddf06b2181e7131cf..984cc6d9a85f594af73aed160f192f5292252b93 100644 (file)
@@ -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}