I am requesting a web server for a document and I want to capture both the document and the related server response headers (e.g. Content-Type: ...). I'm having trouble reading the headers. Here are some sniplets from my Perl script, I left an error for checking:
use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent( 'requiredCustomUserAgent' );
So, at this point I can get the web document, but I want to know what the Content-Type server sent with it. Unfortunately, this is not always the same as the mime type found by the bash 'file command. This file method fails with .js or .css documents.
source share