use LWP::UserAgent; use HTTP::Request; use HTTP::Response; #trying to retrieve a dynamically assigned IP address $url = 'HTTP://192.168.1.1/Status.htm'; $passwd = 'AnyPa223d'; $user = 'T1isUserok'; $ua = LWP::UserAgent->new(); $req = HTTP::Request->new(GET => "$url" ); #when these values are hardcoded the autorization is ok $req->authorization_basic('T1isUserok','AnyPa223d'); #when I use these same values as parms this same code fails $req->authorization_basic($user,$passwd); ##continue $req->header('Accept', => 'text/html'); $response = $ua->request($req); print $response->content; exit 0;
In reply to Re: authorization_basic
by Anonymous Monk
in thread authorization_basic
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |