|
Posted by Stefano on 08/12/07 21:50
Ulf,
thank you a lot for your answer. I've never used Curl before and I am trying
to do right now what you suggested.
So, after curl_init(), using the function :
curl_setopt($curl, CURLOPT_HTTPAUTH, 'username:password');
I get the same error message as before: 401 Unauthorized.
But looking at curl_setopt() specifications, the option CURLOPT_HTTPAUTH can
be set to values CURLAUTH_BASIC, CURLAUTH_DIGEST and so on depending by the
authentication methods to use.
So I should write for example:
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
Seems that username:password is not accepted as CURLOPT_HTTPAUTH set value.
In that case where should I specify login and password ?
Thank you again.
Stefano
"Ulf Kadner" <dr_logic@gmx.net> ha scritto nel messaggio
news:f9nji0$fdc$02$1@news.t-online.com...
> Stefano wrote:
>> I have to send a restart command to an IP camera from a PHP script. The
>> command is as follow:
>>
>> http://192.168.1.5/axis-cgi/admin/restart.cgi
>>
>> $headers.="Authorization: Basic root:password_root".$br.$br;
>
> Dont know if this is the right header.
> I use allways PHPs CURL extension. It works fine.
>
> e.g.: curl_setopt($curl, CURLOPT_HTTPAUTH, 'username:password');
> http://php.net/curl
>
> It requires also an min. PHP version 5.*
> PHP 4.4.2+ supports it to but official documentation says "avialable for
> version 5 and above". May it helps you.
>
> So long, Ulf
>
> --
> _,
> _(_p> Ulf [Kado] Kadner
> \<_)
> ^^
Navigation:
[Reply to this message]
|