How to get CGI request-URL

Gilles Lenfant glenfant at NOSPAM.bigfoot.com
Fri Jul 4 18:04:11 EDT 2003


"Hallvard B Furuseth" <h.b.furuseth(nospam)@usit.uio(nospam).no> a écrit
dans le message de news: HBF.20030704ty6d at bombur.uio.no...
> How can I get the URL the user typed (except the part after '?') with
> the cgi module?
>
> I expect the 'Host:' HTTP header + os.environ['SCRIPT_NAME'] would do
> it, but I don't see how to find the Host header.  The www server has
> several names, so I can't just use the default host name.
>
> --
> Hallvard

Don't remember but...

There's a test() function in the cgi module that shows the special data
available from a CGI script.

--Gilles





More information about the Python-list mailing list