superagent icon indicating copy to clipboard operation
superagent copied to clipboard

Retry only on when certain response codes

Open narender56 opened this issue 3 years ago • 0 comments

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!

narender56 avatar Aug 05 '21 16:08 narender56