Wrapping Saloon into an api class #390
Unanswered
thedangler
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm wondering how you would wrap Saloon connection and requests into one larger API.
I have an API that I'm connecting to that has about 15 end points.
I've created the class, most of the time its just the methods return $this->connector->send(new GetSomething());
I'm wondering if I should replicate some of the saloon request properties so that calling more complicated requests work easier.
Have you run into the situation where you needed to implement a whole API with Saloon.
For example my GetOrders request can be paginated and I can also set min and max dates to search.
But then what happens if I want to use Caching....
I was thinking of just setting the request to a protected variable and wrapping the send method that would then send the set request. I could make a bunch of methods that wrap the request methods like disableCaching()
Seems sloppy though.
Looking for some advice.
Thanks for this project, I love using it.
Beta Was this translation helpful? Give feedback.
All reactions