-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Description
I think it would be useful to have some pathway to modify the initial request before retrying in cases where failure is expected and can be rectified.
Say you make a request to an endpoint with an expired token. This would allow us to request a new token before retrying. It's totally possible that this functionality should live outside of the existing "step" functionality offered by this library, but figured I'd throw it up for discussion. It's also possible this functionality exists elsewhere in which case please let me know as I'm pretty new to the project!
I imagined it to look something like this
Req.get("https://www.example.com/some/private/resource",
auth: {:bearer, "foo"},
retry: fn request, _response ->
{true, Req.Request.put_header(request, "authorization", "Bearer bar")}
end
)
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels