api-http
Simple Node.js class for performing HTTP requests.
npm install api-http
Example Usage
; const facebook = 'https://graph.facebook.com/v2.5/'; const person = await facebookconsole;
Methods
.get(), .delete(), .head()
Arguments: [path, query]
Example Usage:
var api = 'http://example.com/';// http://example.com/users?online=trueapi;
.post(), .patch(), .put(), ... etc.
Arguments: [path, body, query]
Example Usage:
api;
.withAccessToken(accessToken)
Create a new APIHTTP client scoped with an OAuth Bearer access token:
Example:
facebook
.withBasicAuth(username, password)
Create a new APIHTTP client scoped with a Basic Access Authorization header:
Example:
api