>Mark Knoop <> wrote:
>> Hi
>> 
>> I would like to pass through almost all http request headers from the
>> browser that accesses my gci script to a request that I make to
>> another host.  
>> 
>> I can obtain a list of all HTTP request header names by using the cgi
>> http() function and access the values by using
>> $ENV{$http_header_name};  
>> 
>> Some of the header names I have seen returned are
>> 
>> HTTPS_SERVER_ISSUER
>> HTTP_USER_AGENT
>> HTTP_ACCEPT_LANGUAGE
>> HTTPS_KEYSIZE
>> HTTPS
>> HTTP_REFERER
>> HTTP_ACCEPT_CHARSET
>> HTTP_HOST
>> ...
>> 
>> Now if I want to make a request using the same headers (with perhaps
>>one or two being changed as required - therefore I need to be able to
>> process them  
>> individually) I can use the LWP::UserAgent get() method, however it
>> looks like I should use the header names as they would appear in the
>> http request which are not the same as the header names returned by
>> http().   
>> 
>> (from an example on
>> http://www.perl.com/pub/a/2002/08/20/perlandlwp.html?page=2 )
>> 
>>   $response = $browser->get($url,
>>    'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)',
>>    'Accept' => 'image/gif, image/x-xbitmap, image/jpeg,
>>         image/pjpeg, image/png, */*',
>>    'Accept-Charset' => 'iso-8859-1,*,utf-8',
>>    'Accept-Language' => 'en-US',
>>   );
>> 
>> 
>> So - can anyone suggest a method of getting from HTTP_USER_AGENT to
>> User-Agent - and so on for all http headers present (many of which I
>> will not know in advance)?  
>>
>> It feels like I am missing something really obvious...
>
>AFAIK, the CGI only provides indirect and incomplete access to the
>contents of the original HTTP request via the environment variable that
>you already know about. If you need more complete and accurate access to
>the HTTP request, the CGI is probably not appropriate. What you are
>suggesting sound like something a proxy server might do, so have a look
>at HTTP::Daemon, or even HTTP::Proxy.
>
>HTH

Cheers Brian - will investigate further...

Mark


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to