For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > January 2007 > HTTP Header









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTTP Header
Oliver Block

2007-01-13, 6:55 pm

Hello,

does anybody know, if it is possible to retrieve the full HTTP request header
from apache withing a perl cgi script?

Regards,

Oliver

Purl Gurl

2007-01-14, 6:55 pm

Oliver Block wrote:

> does anybody know, if it is possible to retrieve the full HTTP request header
> from apache withing a perl cgi script?


Apache and other typical servers do not produce request
headers rather produce response headers. Browsers, programs
and such produce request headers.

If you are looking to capture response headers from a server,
there are two modules which make this an easy task.

HTTP::Lite is a decent module for simple capture of http
headers. Lite does not support ftp nor https (secure).

LWP is a good module but slower and more cumbersome than
is Lite. LWP handles a wide range of header types through
adjunct HTTP::Request and HTTP::Response modules.

Both modules are capable of capturing response headers
and capable of producing request headers.

Searching through Google will yield hundreds of script
examples to accomplish this task without use of modules.
Writing your own program without using modules will yield
a fast, efficient and bug free program, when carefully
written and tested.

Response headers from a server may or may not be accurate
as to server type information. HTTP headers, though, must
follow fairly strict guidelines, both response and request.

This is capture of results produced by HTTP::Lite for my server,

Content-Type: text/html
Connection: close
Date: Sun, 14 Jan 2007 14:24:08 GMT
Server: Purl Gurl Choctaw
Choctaw: Chahta Okla! Chahta Yakni! Chahta Okpulot Taha!


Purl Gurl

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com