Reputation: 2008
I am using REQUEST libary(https://github.com/rmccue/Requests) for php to make the http request and getting timeout error all the time . How can i solve this problem? This is small piece of my code:
$response = Requests::get($link,
array(
'Accept'=>'application/json',
'Accept-Charset'=>'utf-8',
"Connection"=> "keep-alive",
));
Error :
cURL error 28: Operation timed out after 10335 milliseconds with 0 out of -1 bytes received
Upvotes: 2
Views: 1118
Reputation: 266
try this
$response = Requests::get($link,
array(
'Accept'=>'application/json',
'Accept-Charset'=>'utf-8',
"Connection"=> "keep-alive",
),array('timeout'=>0));
worked for me. Happy Coding :)
Upvotes: 1