Solved

How to read response header

Posted on 2007-12-04
1
1,761 Views
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.
#!/usr/bin/perl
 
use strict;
use warnings;
 
use LWP;
use LWP::Debug qw(+);
 
my $ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
 
my $url = "http://www.myserver.com/cgi-bin/pdfengine.dll/Upload";
 
my $res = $ua->post(
  $url,
  Content_Type => 'form-data',
  Content      => [
    "ConvertType"      => "File",
    "HTTPOutputStream" => "Y",
    "file"             => [ "C:\\Documents and Settings\\Tom\\Desktop\\Perl\\proposal.docx" ],
  ]
);

Open in new window

0
Comment
Question by:Tomazaz
1 Comment
 
LVL 13

Accepted Solution

by:
marchent earned 50 total points
ID: 20410013
use $res->header('headername');
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
perl search and replace 6 171
Perl, group, sort, count question 6 141
Perl Snippet to Parse String 1 22
Perl script to process a .csv file 18 44
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…

828 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