0.1.3 • Published 10 years ago
request-fork v0.1.3
request-fork
Take a single request object and send it to multiple targets.
Install
npm install request-fork
Usage
var requestFork = require('request-fork')
var req = {
method: 'GET',
url: 'https://mockbin.com/status/502',
headers: {
'User-Agent': 'request-fork'
}
}
var targets = [
"https://mockbin.com/status/200",
"https://mockbin.com/status/404"
]
requestFork(req, targets, function(responses, errors) {
if (errors) throw errors
responses.map(function(res){
console.log(res.statusCode)
})
})
Contributing
Feedback and pull requests are most welcomed.
MIT license
Copyright (c) 2015, Mashape (https://www.mashape.com/)