1.0.0 • Published 5 years ago

ken-fetch v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

ken-fetch

fetch() 函数用于请求接口,其中包含 fetch.get() / fetch.post() / fetch.push() / fetch.delete()。

Installation

npm install ken-fetch --save

const fetch = require('ken-fetch');

GET JSON

fetch.get('/users').then(users => {
  console.log(users);
});

POST JSON

fetch.post('/users', data).then(res => console.log(res));

PUT JSON

fetch.put('/users/:id', data).then(res => console.log(res));

DELETE JSON

fetch.delete('/users/:id').then(res => console.log(res));