I am using Laravel's Http facade to call APIs. Since I have to call multiple APIs, I have created a job and called the APIs from the job. This is working in my local environmental, but when tested in a staging server, it is giving the following error.
GuzzleHttp\Exception\RequestException: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See .php?id=47204 for more information. (see .html) for ;offset=0&sort=name%3Adesc in /var/lib/jenkins/workspace/sonar-iq/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:276
I have already set the follwing options to Http facade.
'verify' => false,'timeout' => 0,
'debug' => true,
'curl' => [
CURLOPT_FORBID_REUSE => false,
CURLOPT_FRESH_CONNECT => true
]
This issue is only happening while calling the APIs from the queue:work, when calling normally, the issue does not happen.