Skip to content

All requests should have the option to pass $tries #203

@MagicLegend

Description

@MagicLegend

Overview/summary

Currently the abstract API calls will not handle rate limiting because $tries is not passed on here:

switch ($httpMethod) {
case "get":
$response = $client->get($path, [], $params);
break;
case "post":
$response = $client->post($path, $body, [], $params);
break;
case "put":
$response = $client->put($path, $body, [], $params);
break;
case "delete":
$response = $client->delete($path, [], $params);
break;
}

Thus $maxTries will default to 1:

$maxTries = $tries ?? 1;

Motivation

We ran into rate limiting issues that weren't handled by the library.

Possible solution

In Base.php it should take apart the $params array and take out a tries value from there, to pass it on to the appropriate function. Another solution would be to simply add an optional parameter up the chain, but that would involve changing every function in this library.


Checklist

  • I have described this enhancement in a way that is actionable (if possible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions