request-fork

0.1.3 • Public • Published

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/)

Package Sidebar

Install

npm i request-fork

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • montanaflynn