curl-users
libcurl in perl - username/password pop up box
Date: Tue, 21 Oct 2003 15:15:48 -0700
I'm trying to use libcurl in perl to accomplish the following task, I was
successful using command line curl the following way:
basically it's a popup box with username and password.
curl - u username:password http://proctected-url
but in perl as a simple test, I get a 401 Unauthorized
!/usr/local/bin/perl
use WWW::Curl::easy;
my $body="";
my $curl=WWW::Curl::easy->new();
my $code = $curl->setopt(CURLOPT_USERPWD, "username:password");
$code = $curl->setopt(CURLOPT_URL, "http://protected-url");
$code = $curl->setopt(CURLOPT_FILE, \$body);
$curl->perform();
print $body
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
Received on 2003-10-22