I just want to validate the website link whether it is connecting or not. I added the website also in the code. Please show some light on this.
Here is my code:
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $timeout = $ua->request_timeout;
$ua = $ua->request_timeout(10);
my $res = $ua->get('https://www.aba.com')->result;
if ($res->is_success) { print 'Success' }
elsif ($res->is_error) { print 'Failed ' . $res->message }
elsif ($res->code == 301) { print 'Redirect Success ' . $res->headers->location }
else { print 'Manual Check Required URL...' }
The above code is giving the following failed message:
Failed Service Temporarily Unavailable
Anyhow, I resolved the failed issue, it may be useful to someone else:
The result is: