Skip to content

bpinhosilva/lite-restclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lite-restclient

Simple rest client to connect with APIs services.

Installation

    $ npm install --save lite-restclient

Notes

Node version: >= 6 (not tested with previous versions).

This module uses promises.

Sample code

    'use strict';
    
    let liteRestClient = require('lite-restclient');
    let Request = liteRestClient.request;
    let RestClient = liteRestClient.client;
    let myRestClient = new RestClient();
    
    let requestOptions = {
        qs: {
            q: 'nodejs'
        },
        url: 'http://www.google.com'
    };
    
    let request = new Request(requestOptions);
    
    myRestClient.get(request.getPrototype())
        .then(result => {
            console.log(result);
        }).catch(err => {
            console.log(err);
    });

About

Simple rest client to connect with APIs services.

Resources

License

Stars

Watchers

Forks

Packages

No packages published