Skip to content

luisfcolon/js-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Api Client

No Maintenance Intended Build Status Coverage Status GitHub license NPM downloads GitHub issues

Javascript api client wrapper around Axios.

Installation

With yarn

yarn add js-api-client

With npm

npm install js-api-client --save

Usage

import ApiClient from 'js-api-client';

const client = new ApiClient({
  baseURL: 'https://www.some-api-base-url.com',
});

// get

const getResponse = client.get('/users/1')
  .then(successHandler)
  .catch(errorHandler);

// post
    
const userData = {
  firstName: 'Luis',
  lastName: 'Colon',
};

const postResponse = client.post('/users', userData)
  .then(successHandler)
  .catch(errorHandler);

// etc

About

Javascript api client wrapper for Axios

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages