English 中文(简体)
1. 使用具有异构体认证的LWP时,次例行入境的宽度
原标题:Wide character in subroutine entry when using LWP with NTLM authentication

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,可进行罚款。 :Base64。 如果比特含有超过255条代码的特性,则亚特兰大的条目。

Am I 在这里缺少一些必要的东西,或者这在Authen:NTLM<<>>?

问题回答

员额是什么? 也许有坏数据。

引证:

my $post_encoded = encode_utf8($post);
print Dumper($post,$post_encoded);
my $req = HTTP::Request->new("POST" => $url, $hdr, $post_encoded);




相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...