M
mnrao13
Hi,
When i am trying to acess the the following
through user agent. I am not getting the response
properly.
URL:- https://accessnet.state.nj.us/home.asp
Code:-
$ua = LWP::UserAgent->new(agent =>'Mozilla/4.0
(compatible; MSIE 5.01; Windows NT 5.0)',
timeout => 45,
requests_redirectable => ['GET', 'HEAD', 'POST']);
$ua->cookie_jar($cookie_jar_tmp);
my $req = HTTP::Request->new(GET =>
'https://accessnet.state.nj.us/home.asp');
# send request
my $res = $ua->request($req);
my $r = $res;
my @redirects;
while ($r) {
$res = $r;
$r = $r->previous;
push (@redirects, $res) if $r;
}
print $res->as_string;
I am not getting the reason where i am failing. Please
help me out to acess the given URL through perl.
Thanks
Nageswara Rao.
When i am trying to acess the the following
through user agent. I am not getting the response
properly.
URL:- https://accessnet.state.nj.us/home.asp
Code:-
$ua = LWP::UserAgent->new(agent =>'Mozilla/4.0
(compatible; MSIE 5.01; Windows NT 5.0)',
timeout => 45,
requests_redirectable => ['GET', 'HEAD', 'POST']);
$ua->cookie_jar($cookie_jar_tmp);
my $req = HTTP::Request->new(GET =>
'https://accessnet.state.nj.us/home.asp');
# send request
my $res = $ua->request($req);
my $r = $res;
my @redirects;
while ($r) {
$res = $r;
$r = $r->previous;
push (@redirects, $res) if $r;
}
print $res->as_string;
I am not getting the reason where i am failing. Please
help me out to acess the given URL through perl.
Thanks
Nageswara Rao.