Php 每个请求发送两次
我有follow curl命令 在本地服务器上运行需要7秒钟,我发现太长了,我看到了服务器日志,意识到curl每次发送两次请求Php 每个请求发送两次,php,curl,Php,Curl,我有follow curl命令 在本地服务器上运行需要7秒钟,我发现太长了,我看到了服务器日志,意识到curl每次发送两次请求 $url = "http://192.168.0.106:8080/v1/devices/$deviceID/d0status/?access_token=$dispositivo"; // Initiate curl $ch2 = curl_init(); // Disa
$url = "http://192.168.0.106:8080/v1/devices/$deviceID/d0status/?access_token=$dispositivo";
// Initiate curl
$ch2 = curl_init();
// Disable SSL verification
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch2, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);//envia informação
curl_setopt($ch, CURLOPT_POSTFIELDS, array('params' => 'l1,HIGH'));//desliga tomada
curl_setopt($ch2, CURLOPT_TIMEOUT_MS, 1000);//
$result2=curl_exec($ch2);
curl_exec($ch2);
// Closing
curl_close($ch2);
我找到了解决方案我有两个curl\u exec