-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use the timeout method? #97
Comments
I suggest you review the README docs again, your code for making a POST request is wrong. |
Hi, Thank you again @ahmadnassri, i've try to put the timeout method in the constructor and it doesn't work and then actually I have no idea where to put the timeout method again, // get all shipping cost from one city to every city
Route::get('/{origin}/{courier}', function ($origin,$courier) {
$client = new AbcClass("apikey");
$cities = $client->getCity();
$body = $cities->body;
//get allcity array
$allCity = $body->abcapi->results;
//make new post request for each city
foreach ($allCity as $city) {
$costs = $client->getCost($origin, $city->city_id, 1000, $courier);
$value = $costs->body;
$cost = $value->abcapi->results[0]->costs[0]->cost[0]->value;
echo $city->city_id . "," . $city->city_name . "," . $cost . "<br/>";
} the code is working but it stops in the middle because of maximum exceed 60 sec. |
sounds like the time out on the PHP level is still triggering, not unirest. |
I also try
}
The text was updated successfully, but these errors were encountered: