jitender has asked for the wisdom of the Perl Monks concerning the following question:
sub remove{ my ($user) = shift; my $ua = new LWP::UserAgent; $ua->agent('Mozilla/4.5'); ## HERE I HAVE TO LOGIN INTO http://test.com/ THIS url using u +sername:test and password:test my $url_arg = ''; if ($ENV=~ /^Dev/i) { $url_arg = "http://test.com/test?USERID=$user"; } my $url = URI::URL->new($url_arg); my $req = HTTP::Request->new ('GET',$url); $res = $ua->request($req); if ($res->is_success) { return $res; }else { print "Content-type:text/html \n\n"; print $res->error_as_HTML; } exit 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl script to login into one url and again need to use the url
by Corion (Patriarch) on Aug 23, 2017 at 10:42 UTC | |
by thanos1983 (Parson) on Aug 23, 2017 at 12:21 UTC | |
|
Re: Perl script to login into one url and again need to use the url
by thanos1983 (Parson) on Aug 23, 2017 at 10:19 UTC |