api_client

0.0.2 • Public • Published

Wrapper over request module to build simple Web API clients.

Example:

 
    var api_client = require('./api_client'),
        clientOpts = {
            baseURL: 'http://jsonplaceholder.typicode.com/',
            timeout: 30000
        };
 
    api_client.createAPIPClient(clientOpts).request('/posts/1')
        .then(function (data) {
            console.log('Received response: ' + data.body);
        })
        .catch(function (error) {
            console.log('Request finished with error: ' + error);
        }
    );

Package Sidebar

Install

npm i api_client

Weekly Downloads

2

Version

0.0.2

License

ISC

Last publish

Collaborators

  • vovanec