Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d99e534

Browse files
committed
Fixed typos and bug in the second example, reported by Scott Schram
<[email protected]>. This closes bug #122236.
1 parent 4526f2a commit d99e534

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/lib/libhttplib.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ \subsection{Examples}
137137
>>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
138138
>>> h = httplib.HTTP("www.musi-cal.com:80")
139139
>>> h.putrequest("POST", "/cgi-bin/query")
140+
>>> h.putheader("Content-type", "application/x-www-form-urlencoded")
140141
>>> h.putheader("Content-length", "%d" % len(params))
141142
>>> h.putheader('Accept', 'text/plain')
142143
>>> h.putheader('Host', 'www.musi-cal.com')
143144
>>> h.endheaders()
144-
>>> h.send(paramstring)
145+
>>> h.send(params)
145146
>>> reply, msg, hdrs = h.getreply()
146-
>>> print errcode # should be 200
147+
>>> print reply # should be 200
147148
>>> data = h.getfile().read() # get the raw HTML
148149
\end{verbatim}

0 commit comments

Comments
 (0)