1,1=>2); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $rtn = curl_exec($ch);//CURLOPT_RETURNTRANSFER 不设置 curl_exec返回TRUE 设置 curl_exec返回json(此处) 失败都返回FALSE curl_close($ch);
PHP用CURL发送Content-type为application/json的HTTP/HTTPS请求
本文链接:https://lxyit.com/article/show/69.html
-- EOF --
作者 admin
发表于 2015-05-17 22:35:46 ,最后修改于 2015-05-17 22:35:46