in reply to LWP and POST

from the LWP documentation:
# Create a request my $req = new HTTP::Request POST => 'http://www.perl.com/cgi-bin/BugGl +impse'; $req->content_type('application/x-www-form-urlencoded'); $req->content('match=www&errors=0'); # Pass request to the user agent and get a response back my $res = $ua->request($req);

Replies are listed 'Best First'.
RE: RE: LWP and POST
by Anonymous Monk on Feb 15, 2000 at 05:54 UTC
    OK, now how can one know if the call succeded or failed and how it failed?
      Did you ever get an answer on this? Looks like not publically, at least.

      The object stored in $res (as given in the above example) has methods you can get at to find out what you want to know. Try this after the code Kasei provided:

      if ($res->is_success) { print $res->content; } else { print $res->error_as_HTML; }

      I hope you can extract from that sample; let me know if you need more info. By the way, I really like Web Client Programming with Perl but, alas, it's no longer in print. Betcha could find a used copy out there somewhere.

           - Muse