【发布时间】:2015-04-19 08:44:32
【问题描述】:
我想使用 Guzzle 和 Silex 向 https 页面发送请求。
使用 http url 我有一个响应:
app->get('/',function() use ($app, $client){
$response = $client->get("http://www.google.fr");
var_dump($response);
});
我的回答:
object(GuzzleHttp\Message\Response)[102]
private 'reasonPhrase' => string 'OK' (length=2)
private 'statusCode' => int 200
private 'effectiveUrl' => string 'http://www.google.fr' (length=20)
private 'headers' (GuzzleHttp\Message\AbstractMessage) =>
array (size=13)
'date' =>
array (size=1)
0 => string 'Wed, 18 Feb 2015 10:57:37 GMT' (length=29)
'expires' =>
但是使用 https :
$app->get('/',function() use ($app, $client){
$url = "https://api.zoapp.com/v1/stc/cans/directory/pub/Employees";
$response = $client->get("https://www.facebook.com/");
var_dump($response);
});
我必须出错:
RequestException in RequestException.php line 51:
和
RingException in CurlFactory.php line 126:
详情:pastbin link
【问题讨论】: