How does a CGI script get complete request header text ?

henk_p at my-deja.com henk_p at my-deja.com
Mon Sep 27 10:05:41 EDT 1999


In article <7sju0v$pc2$1 at nnrp1.deja.com>,
  rturpin at my-deja.com wrote:
> Is there a way for a CGI script to get the complete header text,
rather
> than just the preparsed contents that are provided in the environment
> variables?.

This is not possible. The apache mod_cgi module does not pass these
headers down to the script. It uses the original header to build the
environment for the script.

If you really need the headers (and the info you need cannot be
reconstructed from the env. vars, query string or POST data) then you
would need to write your own cgi like module for apache.

At the moment I am working on a module for apache called mod_psi.
(Python Script Interface). with this module requests for url with
extension .psi are routed to a pythons script listening on some port.
(This way the script is persistent over multiple requests, so I can keep
my db connections open).
At the moment this passes the normal cgi headers to the python script.
It would be very easy to also pass the original client request headers.

I you are interested, mail me at csg6031 at wing.rug.nl, I will mail you
the psi_mod source (C) and hello world example (python).


Henk.


Sent via Deja.com http://www.deja.com/
Before you buy.




More information about the Python-list mailing list