|
Hi all,
I have written a perl script to hit one external url using proxy to get a session id. But i am getting the "400 Bad Request" error
I am attaching the code below.
**************************************************
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
my $uri = 'https://abc.efg.com:443/cgi-bin/GetSessionId.cgi?cmd=get_session_id&uid=7777777&uip=1.1.
+1.1&gid=am1';
my $ua = LWP::UserAgent->new;
$ua->proxy(['http','https'], 'http://myproxy.abc.com:8080');
$ua->credentials(
'abc.efg.com:443',
'Server',
'am1' => '12sddr3'
);
my $request = HTTP::Request->new('GET', $uri);
my $response = $ua->request($request);
print %$response,"\nResp\n";
if ($response->is_success) {
print "Success\n";
} else {
print "Failed to GET '$uri': ", $response->status_line, "\n";
}
***********************************************
When I hit the url from my local browser it is working fine.
I am using perl 5.8.8
Can any one help me to resolve this error.
Thanks in advance
regards,
deepu
|