mohankumarg
Technical User
Hi All,
My standalone PERL script that need to connect to web using HTTP & LWP, throws the error "500 Can't connect to (Bad hostname '
The program works fine when I access intranet web pages.
require HTTP::Request;
require LWP::UserAgent;
require HTTP::Headers;
$h = HTTP::Headers->new;
$h->proxy_authorization_basic("user1", "pass123");
$request = HTTP::Request->new('GET', ' $h);
# $request = HTTP::Request->new('GET', '
print "Created connection: $request", "\n";
$ua = LWP::UserAgent->new;
$response = $ua->request($request);
print "Sent request: ", $response->is_success, "\n";
if ($response->is_success) {
$content = $response->content;
}
else {
$content = 'Error occured';
print STDERR $response->status_line, "\n";
}
When I browse any internet websites through browser, the firewall displays the authentication popup. I can access the websites only after entering the valid network id and password in popup.
Any solution to this problem?
My standalone PERL script that need to connect to web using HTTP & LWP, throws the error "500 Can't connect to (Bad hostname '
The program works fine when I access intranet web pages.
require HTTP::Request;
require LWP::UserAgent;
require HTTP::Headers;
$h = HTTP::Headers->new;
$h->proxy_authorization_basic("user1", "pass123");
$request = HTTP::Request->new('GET', ' $h);
# $request = HTTP::Request->new('GET', '
print "Created connection: $request", "\n";
$ua = LWP::UserAgent->new;
$response = $ua->request($request);
print "Sent request: ", $response->is_success, "\n";
if ($response->is_success) {
$content = $response->content;
}
else {
$content = 'Error occured';
print STDERR $response->status_line, "\n";
}
When I browse any internet websites through browser, the firewall displays the authentication popup. I can access the websites only after entering the valid network id and password in popup.
Any solution to this problem?