1.0.8 • Published 5 years ago
request-loop v1.0.8
REQUEST-LOOP
Options based on request-promise-native, request-promise, request
Auto retry request (default up to 10 times) when error
npm install 0x0a0d/request-loop
const Request = require('request-loop');
const request = new Request.defaults({
headers: {
key: 'Should show with key'
}
});
request.get('https://wtfismyip.com/headers', {
headers: {
'key-trap': 'Should show with key-trap'
}
}).then(body=>console.log(body)).catch(console.error);
Function
function request(url, options, retryTimes = 10);
##Jar
Request.jar
##handleError
Request.handleError = function(e, remainRetryTimes)