A simple fetch-like CURL wrapper for NodeJS.
const curl = require('simple-curl')
curl('https://google.com', {
headers: {
'test': 'working'
},
}, r => {
console.log(r.headers)
console.log(r.body)
});
If a body is provided, it won't be considered unless the method has been set as POST
const curl = require('simple-curl')
curl('https://google.com', {
method: 'POST',
headers: {
'test': 'working'
},
body: 'test'
}, r => {
console.log(r.headers)
console.log(r.body)
});