Test:
Request for a URL and check if same URL was opened or it is redirected to some other URL
Solution:
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://www.google.com');
$tmp=$response->request->uri;
if($tmp eq 'http://www.google.com')
{
print "no redirection\n";
}
else
{
print "redirected to $tmp\n";
}

No comments:
Post a Comment