How to read response header

Posted on 2007-12-04
Last Modified: 2012-05-05
I use perl code below to post data to ours server, how to read response $res header? HTTP response header contain additional data and I need to retrieve it using perl.

use strict;

use warnings;

use LWP;

use LWP::Debug qw(+);

my $ua = LWP::UserAgent->new;

$ua->agent("MyApp/0.1 ");

my $url = "";

my $res = $ua->post(


  Content_Type => 'form-data',

  Content      => [

    "ConvertType"      => "File",

    "HTTPOutputStream" => "Y",

    "file"             => [ "C:\\Documents and Settings\\Tom\\Desktop\\Perl\\proposal.docx" ],



Open in new window

Question by:Tomazaz
1 Comment
LVL 13

Accepted Solution

marchent earned 50 total points
Comment Utility
use $res->header('headername');

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now