Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function request (method, url, body, headers) {
return popsicle.fetch(url, {
body: body,
method: method,
headers: headers
}).then(function (res) {
return res.text()
.then(body => {
return {
status: res.status,
body: body
}
})
})
}
function fetchJsonPromise(url) {
return popsicle.fetch(url).then(response => response.json());
}