perlquestion
Puma_perl
Dear perl gurus:
<p>
I am humbly asking you for your assistance. I was trying to use LWP::UserAgent to go to a
password protected ASP page (my login/password works fine with IE browser). The code I have written is like this:
<p>
<code>
my $h = new HTTP::Headers
Content_Base => '$url';
$h->authorization_basic($uname, $password);
my $request = HTTP::Request->new( 'GET', $url, $h ) ;
my $ua = LWP::UserAgent->new;
my $response = $ua->request($request);
### get content of this HTML
$content = $response->content;
#print $content;
</code>
<p>
These lines work well with other web pages written in CGI but it did not work for a link written in ASP. Here is the error I got from the run:
<br>
"HTTP 401.2 - Unauthorized: Logon failed due to server configuration Internet Information Services".
<p><br>The returned HTML also suggested:
<br>"This is
usually caused by a server-side script not sending the proper WWW-Authenticate header field. Using Active Server Pages scripting this is done
by using the AddHeader method of the Response object to request that the client use a certain authentication method to access the resource."
<p>
So, it hinted that something might need to be done on the server side. However, since I don't have control/contract from the server hosting this
link, is there any ways that I can solve this problem from my end? Any suggestions or tips will be highly appreciated!
<p>
Thanks!
<p>
Puma_perl