我还没有见过使用Mechanize支持NTLM的例子。有没有人知道我们如何通过Mechanize使用NTLM库?如果不是,LWP会做这项工作吗?
my $mech = WWW::Mechanize->new( 'keepalive' => 1 );
my $url = "http://URL/I/NEED/TO/ACCESS"; <---Requires NTLM authorization
my $username = "username";
my $password = "password";
$mech->credentials($username, $password);
$mech->get($url); 发布于 2013-09-04 05:26:38
根据这个
Using WWW::Mechanize Credentials
您需要确保您使用的是WWW::Mechanize的v1.5.2或更高版本,最终它将使用Authen::NTLM
如果您的真实用户名中有反斜杠,则必须使用单引号或对其进行转义
my $username = "domain\\user"; https://stackoverflow.com/questions/18601510
复制相似问题