0.1.7 • Published 8 years ago

net-action v0.1.7

Weekly downloads
2
License
Apache v2.0
Repository
github
Last release
8 years ago

Net_action

NPM

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 = new NETWORK('http://localhost/test')

Execute GET method:

  net.get
    ressource: 'hello'
    format: 'json'

Execute POST method:

  net.post
    ressource: 'hello/42'
    params: { 'hello': 'world' }
    format: 'json'

Execute PUT method:

  net.put
    ressource: 'hello/42'
    params: { 'hello': 'better world' }
    format: 'json'

Execute DELETE method:

  net.delete
    ressource: 'hello/42'
    format: 'json'

Extended usage

All methods supports success and error callback parameters:

  net.put
    ressource: 'hello/42'
    params: { 'hello': 'better world' }
    successCallback: do_something()
    errorCallback: do_another_thing()
0.1.7

8 years ago

0.1.6

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago