in reply to How do I POST info to a server?
#!/usr/bin/perl -w use LWP; print "Content-type:text/html\n\n"; $url = "http://www.blabla.com/cgi-bin/foobar.pl"; $ua = new LWP::UserAgent; my $req = new HTTP::Request POST => $url; $req->content_type('application/x-www-form-urlencoded'); $req->content('username=snowcrash&passwd=123456'); my $res = $ua->request($req); print $res->content;
|
|---|