import * as consume from 'elifetchmodes6';
Accepts POST, GET, PUT, DELETE
const object = {
method: 'GET',
url:'https://jsonplaceholder.typicode.com/posts/1',
}
consume.fetch(object).then( res => {
console.log(res.data);
}).catch(err => {
console.log(err);
})
const value = {name:"Bob", job:'Software Dev'};
const object = {
method:'POST',
url:'https://jsonplaceholder.typicode.com/posts',
data:{...value}
}
consume.fetch(object).then( res => {
console.log(res.data);
}).catch(err => {
console.log(err);
})