1.2.3 • Published 4 years ago
@unibiz/orbit-base v1.2.3
Table of Contents
Request
Api
Api module is used to call remote api's. It is capable of making GET, PUT, POST and DELETE calls as demonstrated below.
GET call to a server.
import Api from '@unibiz/orbit/api';
const api = Api('<auth token will go here>');
const host = 'http://api.example.com';
api.get(`{host}/status`)
.then(data => {
// Do something with data
})
.catch(err => {
// Handler / log error.
});