Solved

How to read response header

Posted on 2007-12-04
1
1,763 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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
HTTP Error 502.2 - Bad Gateway 3 233
rename outfile before writing 2 76
problem with using the glob function 1 77
Writing a parser for java language 4 91
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

756 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