我试图从api调用中得到响应,
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://fm.transfer-to.com/cgi-bin/shop/topup');
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$response = curl_exec($curl);
echo $response;
$status = curl_getinfo($curl);
curl_close($curl);//以上代码无输出
我试过file_get_contents(),但是
$url ="https://fm.transfer-to.com/cgi-bin/shop/topup";
$responses = split("\n", file_get_contents($url));
foreach ($responses as $response) {
$key = split("=", $response)[0];
$value= split("=", $response)[1];
if($key != "" && $value != "") {
$data[$key] = $value;
}
}失败:failed to open stream: Connection timed out.
当我使用表单向上面的URL请求时,如何从Api获得响应(API返回纯文本,而不是json)。
发布于 2016-04-14 17:57:01
这个https上的服务器有只有TLSv1支持和非常有限和弱的密码只支持,我相信您的PHP库没有就这个配置进行协商。
解决这个问题
看见
https://stackoverflow.com/questions/36620319
复制相似问题