http://qs321.pair.com?node_id=666191

Yappo has asked for the wisdom of the Perl Monks concerning the following question:

Hi all. I am currently working on an improved spider that is able to get not only HTML content but also media that are not linked from the HTML-source directly.
This information is stored in the headers and can be logged with LiveHTTPheaders and/or Tamper Data (Firefox PlugIns). What I would like to do is log the headers as they come in and are sent just like LiveHTTPheaders plugin does.
I have used UserAgent and WWW::Mechanize-no results, even after sending exactly the same headers as they were logged in FF.
I could get results with tshark but that is not what I want.
Question: is it possible to trace ALL incoming and outgoing headers with a CPAN-module that I can strip the location of the media taht are transported in the headers?
To demonstrate what I mean here is an example header from a LiveHTTPheaders log that plays a video after the URL has been loaded:
---------------------------------------------------------- http://somedomain.com/path/path/67c954839cbf962fe044893124536gtre3251. +flv GET /path/path/67c954839cbf962fe044893124536gtre3251.flv HTTP/1.1 Host: somedomain.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.11) +Gecko/20071127 Firefox/2.0.0.11 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 +,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: ip_bt=38; wlrcmd=; __utma=68674883.507175212.1202182535.120218 +2535.1202182535.1; __utmb=68674883; __utmc=68674883; __utmz=68674883. +1202182535.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); newsRea +d=2008-02-04+16%3A47%3A23 HTTP/1.x 200 OK Date: Tue, 05 Feb 2008 03:35:51 GMT Server: Apache Last-Modified: Mon, 04 Feb 2008 05:24:23 GMT Etag: "a0148cea-287267-56362fc0" Accept-Ranges: bytes Content-Length: 2650727 Expires: Mon, 11 Feb 2008 06:18:17 GMT Age: 76654 Keep-Alive: timeout=5, max=128 Connection: Keep-Alive Content-Type: text/plain ----------------------------------------------------------
I have nver succeeded in getting the Host and GET-variable from the server.
Thanks.