Net_action
Easy to use Request wrapper in order to interact with 3L1X1R RESTful API
Install
Install with npm:
npm install net-action
Basic Usage
Require the module:
NETWORK = require 'net-action'
Instantiate with URL:
net = 'http://localhost/test'
Execute GET method:
netget ressource: 'hello' format: 'json'
Execute POST method:
netpost ressource: 'hello/42' params: 'hello': 'world' format: 'json'
Execute PUT method:
netput ressource: 'hello/42' params: 'hello': 'better world' format: 'json'
Execute DELETE method:
netdelete ressource: 'hello/42' format: 'json'
Extended usage
All methods supports success and error callback parameters:
netput ressource: 'hello/42' params: 'hello': 'better world' successCallback: do_something errorCallback: do_another_thing