cURL / Mailing Lists / curl-library / Single Mail


Perl & Curl

From: Jeremy Rottman <>
Date: Mon, 11 Feb 2008 10:17:36 -0800

I am re-writing my rets application in perl, and I have found a few
modules that will help me on my way. One of them being WWW::Curl:easy.

During my testing, I have tested both system curl and perl curl. At this
point I can get the system curl to correctly connect to my server.
However, I am having the hardest time trying to figure out why I cant
get perl curl to connect to the server.

Every time I try to connect, I get a 401 error. I am using the same
connection method that I would use if I was using system curl.

Here is my current code. Any help with this is greatly appreciated.

Perl Code w/ WWW::Curl:easy -

      $curl->setopt(CURLOPT_URL, $site);
              my $err = $curl->errbuff;
              my $info = $curl->getingo(CURLINFO_HTTP_CODE);

Perl code w/ system curl

      system("curl -u $user:$pass --digest $site");

These are the returned headers I get. I know I am using the correct
username and password. Just not sure where I am going wrong with the
curl lib.

      HTTP/1.1 401 Unauthorized
      Content-Length: 1944
      Content-Type: text/html
      Server: Microsoft-IIS/6.0
      X-Powered-By: ASP.NET
      WWW-Authenticate: Digest
      Date: Fri, 08 Feb 2008 22:24:24 GMT
      Connection: close
Received on 2008-02-11