I m 试图利用LWP与NLM认证组合的IIS服务器合作。 当NNTLM认证被转换成服务器时,该代码进行罚款,因此我假定,这里唯一的问题是NNTLM认证。
So far, I have the following:
my $ua = LWP::UserAgent->new(agent => "whatever",
timeout => $timeout, keep_alive => 1);
$ua->credentials( hostname:80 , , $username, $password);
my $hdr = HTTP::Headers->new("Content-Type" => "text/xml; charset=UTF-8",
"SOAPAction" => ""whatever"");
my $req = HTTP::Request->new("POST" => $url, $hdr, encode_utf8($post));
$res = $ua->request($req);
如果我去掉,我收到以下信息:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST http://hostname
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::http::request: Keep the http connection to hostname:80
LWP::UserAgent::request: Simple response: Unauthorized
LWP::Authen::Ntlm::authenticate: authenticate() has been called
Use of uninitialized value in exists at /usr/lib/perl5/vendor_perl/5.8.5/LWP/UserAgent.pm line 560.
Use of uninitialized value in hash element at /usr/lib/perl5/vendor_perl/5.8.5/LWP/UserAgent.pm line 561.
LWP::Authen::Ntlm::authenticate: In first phase of NTLM authentication
[Thu Apr 12 13:55:28 2012] [error] Wide character in subroutine entry at /usr/lib/perl5/site_perl/5.8.5/Authen/NTLM.pm line 346.
LWP::Protocol::collect: read 625 bytes
LWP::UserAgent::request: Simple response: Internal Server Error
使用<代码>wget的同一URL,可进行罚款。
Am I 在这里缺少一些必要的东西,或者这在Authen:NTLM
<<>>?