I have a PHP file that does a POST request via curl to another PHP file, I need to place this request inside a loop and do a 10 request at a time without worrying about the return, is there a way to do this request without have to wait for the answer to make the next call?
Ex: '
for ($i = 1; $i <= 10; $i++) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "/api/atualizar/$i");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_SSLVERSION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// JSON de retorno
$jsonRetorno = trim(curl_exec($ch));
$resposta = json_decode($jsonRetorno);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err = curl_errno($ch);
curl_close($ch);
echo "Item $i enviado!";
}
?> '