【发布时间】:2014-08-20 16:47:51
【问题描述】:
我的正常工作的卷发如下所示:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $authenticateUrl);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($user));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
但是,我的 Guzzle 无法正常工作,如下所示:
$client = new \GuzzleHttp\Client();
$client->setDefaultOption('verifyPeer',false);
$response = $client->post($authenticateUrl,array(
'header' => $headers,
'body' => json_encode($user)
)
);
$status = $response->getStatusCode();
我在 Guzzle post call 中做错了什么?
【问题讨论】:
-
您是否收到任何错误消息?