Shu Cao wrote:
> Hi,
> 
> Sorry, my last email has some errors. The unofficial HTTP header should
> look like "x: y" not "x=y". 
> 
> I am new to Perl CGI programming. And I encounter a difficult problem 
> wish you guys can help me. Thank you! Here is the problem, how can Perl
> CGI program get the unofficial HTTP header value like "x: y". I examine
> the %ENV hash, and found nothing but some standard HTTP headers like
> "Accept", "User-Agent", etc..
> 
> And I check the CGI.pm module too, seems there is no method to get the
> unofficial HTTP headers.
> 

This is going to depend on the web server, as it is the software parsing
the HTTP request, it just passes execution to the CGI and sets up the
environment before hand. So it is up to the web server software to set
in the environment the extra headers, you should check the documentation
for it. It appears that Apache, if you use it, should be passing through
the additional headers with an 'HTTP_' prepended but there is no
guarantee.  Docs:

http://hoohoo.ncsa.uiuc.edu/cgi/env.html

"In addition to these, the header lines received from the client, if
any, are placed into the environment with the prefix HTTP_ followed by
the header name. Any - characters in the header name are changed to _
characters. The server may exclude any headers which it has already
processed, such as Authorization, Content-type, and Content-length. If
necessary, the server may choose to exclude any or all of these headers
if including them would exceed any system environment limits."

Which is linked from:

http://httpd.apache.org/docs/howto/cgi.html#environmentvariables

Which is (obviously) specifically for Apache.

> If you guys know the HOWTO, pls help me. Thank you!
> 
> BTW, English is not my native language, if I have any syntax or grammar
> error, pls forgive me:P
>

Thought it was fine.

> Best Regards,
> Shu Cao
> 
> 

Good luck,

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to