curl-library
Re: Perl & Curl
Date: Wed, 13 Feb 2008 14:09:09 -0800
Dan Fandrich wrote:
> On Wed, Feb 13, 2008 at 12:58:00PM -0800, Jeremy Rottman wrote:
>
>> This is the output I get from CURLOPT_VERBOSE.
>>
>>
>> * About to connect() to rets.armls.mlsrets.com port 80
>> * Trying 65.83.83.235... * connected
>> * Connected to rets.armls.mlsrets.com (65.83.83.235) port 80
>> * Server auth using Basic with user 'CRIL01'
>>
>>> GET /rets/login HTTP/1.1
>>>
>> Authorization: Basic Q1JJTDAxOkpuITIzQA==
>>
>
> You are sending a Basic authorization here...
>
>
>> Host: rets.armls.mlsrets.com
>> Accept: */*
>>
>> < HTTP/1.1 401 Unauthorized
>> HTTP/1.1 401 Unauthorized
>> < Content-Length: 1944
>> Content-Length: 1944
>> < Content-Type: text/html
>> Content-Type: text/html
>> < Server: Microsoft-IIS/6.0
>> Server: Microsoft-IIS/6.0
>> < X-Powered-By: ASP.NET
>> X-Powered-By: ASP.NET
>> < WWW-Authenticate: Digest
>> qop="auth",realm="rets_at_marketlinx.com",nonce="8a37c64e9500f1b4523141b768ae5a83",opaque="13021957456066"
>>
>
> ...but the server requires Digest authorization instead. You need to
> enable Digest (or Any) authorization in curl using the CURLOPT_HTTPAUTH
> setopt.
>
>
>> This however, does not make any sense. As I am using digest auth.
>>
>
> curl doesn't think so.
>
>
>>>> Dan
>>>>
I am using CURLAUTH_DIGEST. Here is the code that I am currently testing
with.
use WWW::Curl::easy;
my $site = "http://rets.armls.mlsrets.com/rets/login";
my $user = "******";
my $pass = "******";
my $curl= new WWW::Curl::easy;
$curl->setopt(CURLOPT_URL, $site);
$curl->setopt(CURLOPT_VERBOSE,1);
#$curl->setopt(CURLOPT_RETURNTRANSFER, 1);
$curl->setopt(CURLOPT_USERPWD,"$user:$pass");
$curl->setopt(CURLOPT_HTTPAUTH,CURLAUTH_DIGEST);
$curl->perform;
my $info = $curl->getinfo(CURLINFO_RESPONSE_CODE);
Received on 2008-02-13