Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4526f2a commit d99e534Copy full SHA for d99e534
1 file changed
Doc/lib/libhttplib.tex
@@ -137,12 +137,13 @@ \subsection{Examples}
137
>>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
138
>>> h = httplib.HTTP("www.musi-cal.com:80")
139
>>> h.putrequest("POST", "/cgi-bin/query")
140
+>>> h.putheader("Content-type", "application/x-www-form-urlencoded")
141
>>> h.putheader("Content-length", "%d" % len(params))
142
>>> h.putheader('Accept', 'text/plain')
143
>>> h.putheader('Host', 'www.musi-cal.com')
144
>>> h.endheaders()
->>> h.send(paramstring)
145
+>>> h.send(params)
146
>>> reply, msg, hdrs = h.getreply()
->>> print errcode # should be 200
147
+>>> print reply # should be 200
148
>>> data = h.getfile().read() # get the raw HTML
149
\end{verbatim}
0 commit comments