Simple http service
GET:
const http = new HttpService();
// without params
http.get('/api/users')
.then(res => console.log(res))
.catch(err => console.log(err));
// with params
let params = {
id = 1
};
http.get('/api/users', params)
.then(res => console.log(res))
.catch(err => console.log(err));
// with response text/html
http.get('/api/users', params, 'text')
.then(res => console.log(res))
.catch(err => console.log(err));
POST:
const http = new HttpService();
let params = {
id: 1
};
http.post('/api/users', params)
.then(res => console.log(res))
.catch(err => console.log(err));
// with response text/html
http.post('/api/users', params, 'text')
.then(res => console.log(res))
.catch(err => console.log(err));
under construction