needle-retry
Combines needle with retry to account for unstable webservers. Thus, needle-retry will retry for a certain number of times (default 5) before giving up. Currently implements request
and get
. Tests currently only cover GET
requests but everything should work too, as this is basically just a wrapper.
Installation
npm install needle-retry
Options
Options can be passed in as the second parameter, as an object with a property needle
for needle options and a property retry
for retry options. This module has a single option, fullDocument
that will make it retry if a full HTML document is not received. Defaults to false
. Default options:
var options = needleRetry: fullDocument: false needle: follow_max: 20 retry: retries: 5
Have a look at the respective doc pages for needle and retry for a list of available options.
Example
var needle = ; needle;
Example request
var needle = ; var options = needleRetry: fullDocument: false needle: follow_max: 20 retry: retries: 5 var data = foo: 'bar' needle;