I have API similar to this:
GET /api/token?key={key}
GET /api/data?key={token}
GET /api/data2?key={token}
Before using any other call, I must query the first request and get the token by the fixed key. Then using the thing token, I can make any other query.
Definitely I can define the client as is and in my higher-level logic I can query the token, save it and then pass as an argument, but I'm wondering if it is possible to add transparently, potentially with Polly if needed.
I can create a separate Refit client that can retrieve the token only, and then inject it as a handler to the main client. so whenever I make any call, if I don't have a token, the handler would retrieve a token and pass it.
I'm wondering if there is a more standard way to do so