dcsimg
December 5, 2016
Hot Topics:

Data access via the Web

  • May 25, 1999
  • 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



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

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

Sitemap | Contact Us

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