3

I got delicious account a few days ago, and I want to use its API with PHP/curl. I use such a function:

$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.delicious.com/v1/posts/add?&url=SOME_URL");
curl_setopt($ch, CURLOPT_USERAGENT, $USER_AGENT);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $CONNECT_TIMEOUT);
curl_setopt($ch, CURLOPT_TIMEOUT, $CONNECT_TIMEOUT);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "MY_USER:MY_PASS");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result=curl_exec($ch);
curl_close($ch);
return $result;

It always returns ACCESS DENIED error. I know the code works because I use the same code with Bing API and it works perfectly (also tested with some other sites that use http authorization - works perfectly).

So what is wrong here? My user/pass is OK, since the same URL works if I enter it into browser and type my user/password.

4

1 回答 1

0

如果有人有同样的问题,这里是答案。我联系了 Delicious 团队,问题与他们的 SSL 有关。这是他们发给我的:

“这很可能是我们的 SSL 证书意外过期的结果。我们正在努力尽快解决这个问题,并更新https://delicious.com的证书。安全网站以及 API 应该几小时内又可以工作了”

于 2013-08-27T05:30:14.870 回答