Request Headers In a CGI

Sam Holden sholden at flexal.cs.usyd.edu.au
Fri Sep 10 05:18:03 EDT 2004


On 10 Sep 2004 02:02:23 -0700, Michael Foord <fuzzyman at gmail.com> wrote:
> Is it possible to get at the http request headers in a normal CGI ?
>
> I can't touch the server, so I can't install anything like mod_python.
> I've tried googling but the answer seems to be 'no'.
>
> I know I can reconstruct *most* headers from the environment variables
> - is this my only option ? I've heard of 'non-parsed headers', but I
> don't know how to use them from within a python cgi....

Non-parsed headers are unrelated - they involve the web server not
parsing the CGI response headers but instead sending them directly to
the browser.

What you want can't be done. You can reconstruct most of what you want
via the environment, but not all of it. HTTP Authentication passwords
leap to mind.

-- 
Sam Holden



More information about the Python-list mailing list