Suggestion: "Completing" HTTP support in Python.

Robb Shecter shecter at darmstadt.gmd.de
Thu Jun 15 12:21:36 EDT 2000


Oleg Broytmann wrote:

> On Thu, 15 Jun 2000, Robb Shecter wrote:
> > h = HTTP('my.host.name', '/loginscript', 8080)
> > (code, msg, headers) = h.post()
>
> import urllib
> filename, headers = urllib.urlretrieve("http://my.host.name:8080/loginscript")
>

Thanks for the reply, but I don't think that does what I'm looking for.
(Although - it could very well be that I just don't know how to use the library!)

How do you add HTTP parameters?
How do you specify that the connection should be POST or GET?

I took a look at the latest CVS version of urllib, and saw how it implicitly
switches between GET and POST.  I don't like that too much, because apparently it
doesn't handle parameters for you, so you still have to explicitly code
differently for GET and POST, and hope that the implicit switch does its thing.
Not too clean, IMO.

- Robb




More information about the Python-list mailing list