title: Perl LWP::useragent capture server response headers
body: <p>I'm querying a webserver for a document and I want to capture the both the document and the  related server response headers (esp. Content-Type: ...). I have trouble finding out how to read the headers. Here are some sniplets from my Perl script, I left error checking out for clarity:</p>
  
  <pre><code>use LWP::UserAgent;
  my $ua = LWP::UserAgent-&gt;new;
  $ua-&gt;agent( 'requiredCustomUserAgent' ); # I'm required to set a custom user agent
  $imageData = $response-&gt;content;         # This is the received document
  </code></pre>
  
  <p>So at this point I can retrieve the web document, but I want to know what Content-Type the 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 in case of .js or .css documents.</p>