> -----Original Message----- > From: Hewlett Pickens [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 30, 2002 7:01 PM > To: [EMAIL PROTECTED] > Subject: How To Display Browser Headers > > > Does anyone know of a way to get Microsoft's Internet > Explorer to display > the HTTP headers it transmits? Would like to use them for debugging a > "learning" Perl script I'm trying to write on a client to > talk to a CGI > script under Apache. > > Getting "500" error, and the Apache error log shows > "premature end of script > headers" if I try and send more than one name-value pair. If > I could see > the actual header content being transmitted by IE, my error(s) would > probably stand out like a sore thumb. > > In case anyone wonders "why on earth is he trying to do the > hard way rather > than using a browser" - no browser available. My environment > is described > below. > > ---------- > > Have two mainframe Linux systems (Marist) running under IBM's > VM Operating > System. > > They aren't real world setups. Am using them to learn Linux, > Perl, and CGI. > Apache is on both, but no browser is available. > > Have O'Reilly's "CGI Programming" which helps a lot, but > would like to cut > down on the amount of time its taking to grunt it out.
If you have mod_perl available, you can get at the request headers via the $r->headers_in method. I don't think you can get at the exact request headers under mod_cgi. Most of the headers are mapped to the HTTP_XXX environment variables. Another alternative is to write a quick server, which you can do using the HTTP::Daemon module. This will let you grab the exact headers. If you are trying to write a client, you need to use the LWP family of modules, including LWP::UserAgent and HTTP::Request. Using these, you can construct the proper headers and requests without having to snoop what IE is sending. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]