simple-curl

1.0.22 • Public • Published

simple-curl

A simple fetch-like CURL wrapper for NodeJS.

Usage

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)
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i simple-curl

      Weekly Downloads

      0

      Version

      1.0.22

      License

      ISC

      Unpacked Size

      428 kB

      Total Files

      7

      Last publish

      Collaborators

      • turtleee