-
Notifications
You must be signed in to change notification settings - Fork 19
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
Enable retry on non-GET requests? #34
Comments
I would be happy to see something that added support for retrying non-get requests, but not by default. i.e. it would need to be something that you passed a separate option for. Perhaps if you passed |
Yeah since Sure, I would ensure that any pull requests would be done for both libraries. |
I agree, if specified as a function we should probably retry regardless of method. The rational is because you might wrap this module and decide to enable retries by default, but then unexpectedly receive a POST request and retry that too. e.g. const request = require('then-request');
function awesomeRequest(method, url, options = {}) {
return request(method, url, {...options, retry: true});
} |
Hi,
I was curious why the built-in retry logic only functions for GET requests. Could it be extended so clients could retry for POST requests, or whatever method is used for the request? This is something we have a use case for (yes, I am aware of the dangers in general in retrying a failed POST request, we have a use case where this is desired behavior).
Ie. Would a pull request that modified this line https://github.com/then/then-request/blob/master/src/browser.ts#L65 be accepted
The text was updated successfully, but these errors were encountered: