【发布时间】:2013-02-01 13:51:38
【问题描述】:
最近我开始使用 Sound cloud API (PHP),我决定使用 PHP API by
https://github.com/mptre/php-soundcloud。
但是当我尝试通过此代码从 Sound 云服务器获取访问令牌时:
// Get access token
try {
$accessToken = $soundcloud->accessToken(isset($_GET['code']));
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
在我的脚本中添加以下代码后,SC 返回 401 错误
$curlPath = 'Fullpath\Of\cacert.crt';
$curlSSLSertificate = str_replace(array('/', '\'), DIRECTORY_SEPARATOR, $curlPath);
curl_setopt($ch, CURLOPT_CAINFO, $curlSSLSertificate);
我们添加此代码以修复“请求的 URL 以 HTTP 代码 0 响应”问题
然后我们得到 401 错误。
有什么办法可以解决这个问题。如果是,那么请建议我看看那里..
【问题讨论】:
-
I got the solution. Here it's[链接][1] [1]:stackoverflow.com/questions/8708791/…
标签: php curl soundcloud