DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Perl - Send Form POST
// Manda le informazioni per il login ad un determinato sito
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
my $user = "user";
my $pass = "pass";
my $browser = LWP::UserAgent->new();
my $responde = HTTP::Request->new(POST => "http://www.sito.com/index.php");
$responde->content_type("application/x-www-form-urlencoded");
$responde->content("user=" . $user . "&pass=" . $pass);
$browser->request($responde)->as_string





Comments
Snippets Manager replied on Wed, 2008/07/30 - 4:40pm