0.0.4 • Published 7 years ago

simple-rest-api-client v0.0.4

Weekly downloads
5
License
LGPL-3.0
Repository
github
Last release
7 years ago

Simple REST Api Client

Simple client implementation based on REST Client for Node.js.

Usage

Create config object:

const config = {
    api: {
      host: 'http://localhost/api',
      key: 'dev',
      keyHeader: 'X-Api-Key',
      clientOptions: null // https://github.com/aacerox/node-rest-client#options-parameters
    }  
};

Create client object:

const logger = require('winston'); // or use console object, set null for disable logging
const client = new require('simple-rest-api-client').Client(config, logger);

Call the api method:

client.request('put', '/foo/${id}', {
    path: {id: '78439bb1-1187-43e8-90f6-708e1182a3d6'},
    data: {test: 'hello'}
});
0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago