PDA

View Full Version : perl https request


vinaydubey
02-21-03, 11:07
Friends
Please help me in writing https connection to perl
I need to access or hit https url every 10 minutes
I am java developer
i got some help on web
but not complete
here is my perl program.

#!/usr/bin/perl
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);

# Create a request
my $req = new HTTPS::Request ('POST' , 'https://url.com:8090/file/request.jsp');
$req->connection('keep-alive');
$req->authorization_basic('test', 'test');
$req->content_type('application/x-www-form-urlencoded');
$req->content('');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "Bad luck this time\n";
}


and where will I get all perl module.

thanks
vinay

SaintSinner
06-30-04, 02:40
Hey there, I was just checking to see if you had at least found the modules? I need to track down the 'HTTP::Request' module.

Cheers,

Ben

senza_nome
07-01-04, 10:00
isn't HTTP part of LWP?