[Tutor] Httplib and Proxy
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Sun, 27 Jan 2002 01:33:33 -0800 (PST)
On Sat, 26 Jan 2002, A wrote:
> Can anybody please give me a working example how I can use
> httplib with a proxy if I use POST method?
urllib.urlopen() may be what you're looking for:
http://www.python.org/doc/current/lib/module-urllib.html
If you're using an HTTP proxy, you can first set the 'http_proxy'
environmental variable, and then urllib.urlopen() will use that when it
retrieves http resources. urlllib.urlopen() also supports POST if we send
the data as a second parameter to urlopen().
Good luck!