Minimal Request Promise
request
and request-promise
are great, but I was looking for an some extra-light implementation.
Usage
client.<get|post|put|delete|head>(url, [options])
url
The full url to requestoptions
an http.request options object. Can be extended with abody
attribute.
response: An http.IncomingMessage
object, complemented with a body
attribute containing the response body data;
const client = ; return client ;
Posting data
POST
|PUT
,.. body can be injected in options.body
:
const client = ; return client ;