dcsimg
November 27, 2020
Hot Topics:

Data access via the Web

  • By Piroz Mohseni
  • Send Email »
  • More Articles »

 

# Create a user agent object
  use HTTP::Request::Common;
  use LWP::UserAgent;
  $ua = new LWP::UserAgent;
  $ua->agent("AgentName/0.1 " . $ua->agent);

  # Create a request
  my $req = POST "http://www.gamelon.com/somedir/getinfo.cgi",
  [
   lname     => 'jones',
   id   => '123'
  ];
    
  # Pass request to the user agent and get a response back
  my $res = $ua->request($req);

 
  # Check the outcome of the response
  if ($res->is_success) {
      print $res->content;
  } else {
      print "Bad luck this time\n";
  }





Page 2 of 3



This article was originally published on May 25, 1999

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.


Thanks for your registration, follow us on our social networks to keep up-to-date