Proper echoing of HTTP headers from LWP call ?

Discussion in 'Perl Misc' started by still me, Oct 18, 2007.

  1. still me

    still me Guest

    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,
     
    still me, Oct 18, 2007
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    971
  2. Replies:
    1
    Views:
    387
    [Si]dragon
    Apr 11, 2006
  3. Ian
    Replies:
    2
    Views:
    2,184
  4. Replies:
    2
    Views:
    178
  5. Bob
    Replies:
    7
    Views:
    113
    Joe Smith
    Sep 11, 2005
Loading...

Share This Page