authbox.request-promise-retry

1.0.0 • Public • Published

AuthBox.RequestPromiseRetry

Wrapper of request-promise to support retries using AuthBox.AsyncRetry

Usage

The library wraps the method version of request-promise. It is designed to be a drop in replacement. The most basic usage is:

const rp = require('authbox.request-promise-retry'); // Only need to change require

return await rp({
    method: 'GET',
    uri: 'http://www.education.gov.uk',
});

The above example will pass all the options directly to request-promise, but will wrap the call in a retry using the default api strategy from AuthBox.AsyncRetry.

You can also specify your own retry strategy:

const rp = require('authbox.request-promise-retry');

return await rp({
    method: 'GET',
    uri: 'http://www.education.gov.uk',
    retry: { // Options for authbox.async-retry
        retries: 5,
    },
});

Readme

Keywords

none

Package Sidebar

Install

npm i authbox.request-promise-retry

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

10.2 kB

Total Files

16

Last publish

Collaborators

  • rhys_hampton_io