Littlerequester
Description
Simple NodeJS HTTP/HTTPS request module with no dependency
Support GET, POST, PUT, PATCH, DELETE request type
Test
Tested for NodeJS 4, 5 and 6
Installation
$ npm i littlerequester --save
Usage
With just a string
const littlerequester = ; // Make a request to example.com// you can also directly get json like this -> littlerequester("http://example.com/", "json")
Or with a more complex object
const littlerequester = ; // Make a request to example.com
Or
const littlerequester = ; ;
littlerequester argument doc
2 params
- url - String : An url
- type? - String : json or raw (default to raw) - Optional
OR
param - Object : options An object with the following fields :
- url - String : Request url
- type - String : Return data type either json or raw
- headers - Object : Object with header to use in request (ex: user-agent)
- method? - String : GET, POST, PUT, PATCH, DELETE default to GET if not provided - Optional
- data? - Object : Valid Object for POST, PUT and PATCH request - Optional
Release History
- 0.5.0 add 2nd arg (type - Optional) for request with just a string
- 0.4.0 add request with just an url
- 0.3.0 add POST, PUT, PATCH, DELETE request type
- 0.2.0 Add headers support
- 0.1.0 Initial release