superagent
superagent copied to clipboard
Retry only on when certain response codes
I need to retry request on certain response codes, like 401, 406, Do superagent
support this?
Example:
request
.get('https://example.com/search')
.retryWhen([401, 406]) <-- like this
.then(finished);
.catch(failed);
Any help would appreciated. Thank you!