how do i PUT or POST to a web server?

Greg Jorgensen gregj at pobox.com
Sat Oct 14 23:56:58 EDT 2000


"Andrew" <astuart at NO.mira.SPAMnet> wrote in message
news:39e8e8ff.41ae1 at newton.pacific.net.au...
> Can anyone point me to an example of how I PUT or POST data to a web
server
> using Python?
>
> The Python reference documentation isn't very clear on this, although it
is
> quite clear on how to do a GET

You want httplib. It implements the full HTTP protocol (GET, POST, PUT,
HEAD). You'll have to know about the HTTP protocol, what headers to send,
etc.

urllib is a simple front-end to httplib that just does GET. I assume that's
what you're using.

If your talking to web servers you may find the timeoutsocket module handy:

http://www.timo-tasi.org/python/timeoutsocket.py

--
Greg Jorgensen
Deschooling Society
Portland, Oregon, USA
gregj at pobox.com





More information about the Python-list mailing list