dcsimg
October 23, 2018
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.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

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