A simple simulation of curl software in nodeJS.
Currently, it supports only http/https requests.
Standard Syntax - curl-node curl-node --request get|post|delete|put --data "" --data-location ""
-
Simple GET Request
curl-node https://www.google.co.in/ (Default request is GET)
-
POST Request
curl-node https://www.sample.com/ --request post --data "{'id' : 100,'name' : 'Lakshay'}"
-
POST Request(with file location for data)
curl-node https://www.sample.com/ --request post --data-location "./data.txt"
-
Fetch Only Response Headers
curl-node https://www.sample.com/ --request head
-
Save output to a file
curl-node https://www.sample.com/ > ./sample.txt
#Readings
- Nodejs HTTP Module Documentation - https://nodejs.org/api/http.html#http_http_request_options_callback