Skip to content

Instantly share code, notes, and snippets.

@khayyamsaleem
Created October 23, 2019 18:58
Show Gist options
  • Select an option

  • Save khayyamsaleem/71dcc314153834b1ca70ce6ab15f636b to your computer and use it in GitHub Desktop.

Select an option

Save khayyamsaleem/71dcc314153834b1ca70ce6ab15f636b to your computer and use it in GitHub Desktop.
const fetch = require('node-fetch')
const { odrs } = require('./07-09-2019.json')
odrs.forEach(o => {
fetch('http://localhost:8080/api/v1/odr/raw', {
method: 'POST',
body: JSON.stringify(o)
}).then(res => res.json()).then(j => {
if (!j.success) {
console.log(o)
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment