Hi,

I am in dire need of help with respect to LWP::UserAgend Module.
While searching thru monks, i stumbled across your node and thought you will be able to help me.

I come to the question directly. I have a LWP code using which i am trying to access web page within my office LAN. But i am getting "500 Internal Server Error". The version of Perl with me is 5.6.1.

I give below my code (masking my credentials) :) and the output i got. Please look into it and gimme your comments

#!C:/perl/bin/perl.exe use LWP::UserAgent; use LWP::Debug qw(+); use HTTP::Request::Common; my $url= 'http://punsez138451d/L3NOCALM/default.aspx'; my $ua = new LWP::UserAgent(keep_alive => 1); $ua->credentials('punsez138451d:80','',"MYDOMAIN\\username",'password' +); $request = GET $url; print "--Performing request now...------------------\n"; $response = $ua->request($request); print "--Done with request---------------------------\n"; if( $response->is_success) { print $response->content; } else {perl print 'Error: ', $response->status_line, "\n"; print "===== Request Headers =====\n"; print $response->headers->as_string; print "\n===== Response Headers ====\n"; print $response->headers->as_string; print "\n===== Response Content ====\n"; print $response->content; exit 1; } $contents = $response -> content(); #print $response->status_line(), "\n"; #print $response->headers()->as_string();
My output:

C:\Documents and Settings\venkatesan_G02\Desktop>perl lwp_test.pl LWP::UserAgent::new: () --Performing request now...------------------ LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://punsez138451d/L3NOCALM/defaul +t.aspx LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 762 bytes LWP::Protocol::collect: read 894 bytes LWP::Protocol::http::request: Keep the http connection to punsez138451 +d:80 LWP::UserAgent::request: Simple response: Unauthorized LWP::Authen::Ntlm::authenticate: authenticate() has been called LWP::Authen::Ntlm::authenticate: In first phase of NTLM authentication LWP::Authen::Ntlm::authenticate: Returning response object with auth h +eader: Authorization NTLM TlRMTVNTUAABAAAAB7IAAA4ADgAgAAAACQAJAC4AAAB2ZW5rYXR +lc2FuX0cwM klORkxFVkVMMw== LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://punsez138451d/L3NOCALM/defaul +t.aspx LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 100 bytes LWP::UserAgent::request: Simple response: Internal Server Error --Done with request--------------------------- Error: 500 Internal Server Error ===== Request Headers ===== Connection: close Date: Mon, 13 Apr 2009 18:15:25 GMT Server: Microsoft-IIS/6.0 Content-Length: 100 Content-Type: text/html Client-Date: Mon, 13 Apr 2009 18:15:19 GMT Client-Peer: 4.33.37.49:80 Client-Response-Num: 2 MicrosoftSharePointTeamServices: 12.0.0.4518 Title: Error X-Powered-By: ASP.NET ===== Response Headers ==== Connection: close Date: Mon, 13 Apr 2009 18:15:25 GMT Server: Microsoft-IIS/6.0 Content-Length: 100 Content-Type: text/html Client-Date: Mon, 13 Apr 2009 18:15:19 GMT Client-Peer: 4.33.37.49:80 Client-Response-Num: 2 MicrosoftSharePointTeamServices: 12.0.0.4518 Title: Error X-Powered-By: ASP.NET ===== Response Content ==== <html><head><title>Error</title></head><body>The function requested is + not suppo rted </body></html>
Any help will be greatly appreciated!!!

In reply to Re^3: More NTLM by Anonymous Monk
in thread More NTLM by j.goor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.