I am trying to execute one URL from the CGI script but failing to do.Any inputs are highly welcome.Please find below the two codes used for the same.
use CGI ':standard'; use HTTP::Request; use LWP::Simple qw/get/; $url = 'https://10.204.16.17:16316/ibm/console/login.do?action=secure' +; `wget $url`;
#!/usr/bin/perl use LWP::UserAgent ; use HTTP::Request ; my $URL = 'https://10.204.16.17:16316/ibm/console/login.do?action=secu +re'; my $agent = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1, timeou +t => 30); my $header = HTTP::Request->new(GET => $URL); my $request = HTTP::Request->new('GET', $URL, $header); my $response = $agent->request($request); # Check the outcome of the response if ($response->is_success){ print "URL:$URL\nHeaders:\n"; print $response->headers_as_string; print "\nContent:\n"; print $response->as_string; }elsif ($response->is_error){ print "Error:$URL\n"; print $response->error_as_HTML; }
In reply to Unable to execute URL from perl/cgi script by coolsaurabh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |