【发布时间】:2017-09-25 10:40:15
【问题描述】:
我一直在尝试让技能管理 API 工作,今天早上我遇到了一个新的障碍,但没有任何改变。我得到一个“用户昨晚没有同意这个操作错误”,今天早上没有改变任何东西,这是我得到的 curl 日志:
尝试使用与昨晚相同的代码访问 API,现在我得到了:
string(513) "
* Hostname api.amazonalexa.com was found in DNS cache
* Trying 54.239.28.187...
* TCP_NODELAY set
* Connected to api.amazonalexa.com (54.239.28.187) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to api.amazonalexa.com:443
* stopped the pause stream! * Closing connection 0 "
这是我正在使用的代码:
ob_start();
$out = fopen('php://output', 'w');
// exchange the access token for list of skills
$c = curl_init('https://api.amazonalexa.com/v0/skills/');
curl_setopt($c, CURLOPT_HTTPHEADER, array(
'Authorization: ' . $access_token,
'Accept: application/json',
'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'
));
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_VERBOSE, true);
curl_setopt($c, CURLOPT_STDERR, $out);
curl_setopt($c, CURLOPT_POST, 1);
$r = curl_exec($c);
curl_close($c);
fclose($out);
$debug = ob_get_clean();
var_dump($r);
echo "<BR><BR>";
var_dump($debug);
$d = json_decode($r);
$r 在这种情况下产生 bool(false) 并且 $d 输出 NULL。如果有什么不同,我会在 Godaddy 上托管我的服务器。我仍然可以通过 Amazon 访问 Login 并检索访问令牌。所以,这似乎不是托管问题。
【问题讨论】:
-
问题似乎是暂时的。