1.0.5 • Published 5 years ago

@daluobo/fetchwrap v1.0.5

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

一、安装

npm install @daluobo/fetchwrap;
import fetchWrap  from '@daluobo/fetchwrap';

二、使用

1. get方法

参数为:(api, data = {}, headers = {}, config = {})
fetchWrap.get('/test-fetch')
.then((res) => {
    console.log('res:', res);
})
.catch((err) => {
    console.log('error:', err);
})

2. post方法

参数为:(api, data = {}, headers = {}, config = {})
fetchWrap.post('/test-fetch')
.then((res) => {
    console.log('res:', res);
})
.catch((err) => {
    console.log('error:', err);
})
1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago