我正在尝试通过Perl URI登录Bugzill而我无法通过 “Bugzilla_login=@mentor.com& Bugzilla_password = info。
我需要登录,因为之后我想从bugzilla中抓取一些数据。
my $data = $scraper->scrape(
my $uri=URI->new('http://prdbugzilla.wv.mentorg.com/bugzilla/show_bug.cgi?id=22444')
);
我正在尝试做类似
的事情curl --data "Bugzilla_login=USER&Bugzilla_password=PASSWORD" http://prdbugzilla.wv.mentorg.com/bugzilla/show_bug.cgi?id=19971
答案 0 :(得分:3)
URI
只是构建一个URI对象;它不会生成HTTP请求。请改为LWP::UserAgent
和HTTP::Requset
:
my $req = HTTP::Request->new( POST => 'http://...' );
$req->content('Bugzilla_login=USER&Bugzilla_password=PASSWORD');
然后您可以使用LWP::UserAgent
发送请求。