elifetchmodes6
1.9.5 • Public • Published To install local module into client folder
sudo npm link
get link from path
cd client
sudo npm i (path from npm link
To use
import * as consume from "elifetchmodes6";
Accepts POST, GET, PUT, DELETE
GET
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);
});
Or POST
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);
});
To Demo
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads