HTTPLib and POST problem with '?'

Alex Martelli aleax at aleax.it
Sun Jan 13 11:43:46 EST 2002


A wrote:
        ...
>  h.putrequest("POST", "/cgi-bin/script.cgi?name=Paul")
> 
> but httplib ignores everything after '?' and sends only
> /cgi-bin/script.cgi
>   again
> Does anyone have any idea how it can be change to be ?
>  sent the complete path(script)?

No; this violates the HTTP standards (the ? and after are
only used for GET, to encode the FORM values; in POST, the
form values are sent as the request's data instead of in
the URL) and I don't think you can easily break httplib to
make it violate the standards it supports.

I guess you could copy httplib.py to myownprotocol.py and
tweak it to your heart's content, but you'll also have to
ensure you have other infrastructure in place (servers,
proxies, etc) to support your non-HTTP proprietary protocol.


Alex




More information about the Python-list mailing list