Proper echoing of HTTP headers from LWP call ?

S

still me

I am pulling a web page (form) from a remote source, then echoing them
back to the caller. I use LWP for the call and then just print back
the headers as a string. I am having some issues with the headers back
in the calling browser (like the content type header not being
recognized. I am wondering if there is a perl subtlety I am missing
here that makes my approach incorrect:

my $browser = LWP::UserAgent->new;
$browser->agent("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322)");
my $url = 'https://www.example.com/someform.htm';
my $response = $browser->post( $url,[ %postParams ]);
my $allHeaders = $response->headers->as_string;
print $allHeaders;
print $response->content;

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top