开发者

How to authorize with Test::WWW::Mechanize

开发者 https://www.devze.com 2023-03-23 07:15 出处:网络
I want to test a .htaccess protected page with Test::WWW::Mechanize but I don\'t know how can I send credentials开发者_如何转开发 for the page? I couldn\'t find a function that can handle this.use Tes

I want to test a .htaccess protected page with Test::WWW::Mechanize but I don't know how can I send credentials开发者_如何转开发 for the page? I couldn't find a function that can handle this.


use Test::WWW::Mechanize;
my $mech = Test::WWW::Mechanize->new();
my ($user, $pass) = qw/user pass/;
$mech->credentials($user, $pass);
$mech->get_ok('http://example.com');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号