All my POST-type requests for a specific URL are taking about 3 minutes to return the response , that is, a few seconds after I submit the form , look at the API site and there my data is posted, but on my site the request is pending, after exactly 3 minutes it is finished returning the necessary data.
I believe something is holding response for 3 minutes because I tested the same code in the local environment and it worked quickly (it took about 10 seconds), which may be causing this "slowness" ?
public function http_request($url, $headers, $data = array())
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.binance.com/api/v3/order');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
if ($data) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_ENCODING, "");
$content = curl_exec($ch);
curl_close($ch);
return $content;
}