I am receiving a response from using a curl request. But how do I check whether my curl request throws an error or not? because it takes 15 minutes to give a response from API.(but it works fine while testing in postman)
Can anyone guide me to solve this?
public function getDynamicPriceFromErp($sku, $priceCode)
{
$url = "https://v3.test.com/v1/test/44gggttfff234";
$this->curlClient->setOption(CURLOPT_HEADER, 0);
$this->curlClient->setOption(CURLOPT_TIMEOUT, 2000);
$this->curlClient->setOption(CURLOPT_RETURNTRANSFER, true);
//set curl header
$this->curlClient->addHeader("Content-Type", "application/json");
$this->curlClient->addHeader("Authorization", "Bearer fhY0eXAigoY");
//post request with url and data
$this->curlClient->post($url);
//read response
$response = $this->curlClient->getBody();
return $response;
}