2.0.3 • Published 6 years ago

kin-fetch v2.0.3

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

kin-fetch

依赖于 node-fetch

const kinFetch = require('kin-fetch')


const request = kinFetch({
  url:'', //baseurl
  options:{},
  logger: (err, url, method, status, time) => {
    !err && console.log(url, method, status, time);
  }
})
  • url

非必填

type: string

  • logger

非必填

type: function

  • options

非必填

type: object

node-fetch options

request({
  url:'',//请求的路径为 baseurl + url
  method:'',
  data:{} // GET POST 请求参数
}).then((value) => {
  //success
}).catch((err) => {
  // errot
})
  • url

必填

  • method

非必填 默认 GET

  • data

非必填 默认{}

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago