0.1.7 • Published 4 years ago

@m.wang/fetch v0.1.7

Weekly downloads
11
License
MIT
Repository
github
Last release
4 years ago

安装

  • 安装 @m.wang/fetch
npm install @m.wang/fetch
  • 添加接口权限
"features": [
  { "name": "system.fetch"},
  {"name": "system.prompt"},
]

案例

import fetch from "@m.wang/fetch"
fetch("http://domain?paramA=example")
  .then( function(response){
    console.log("success")
  },
  function(){
    console.log("fail")
  })

配置

fetch.defaults.baseUrl="http://domain/"
fetch.defaults.responseType='text'
fetch.defaults.timeOut = 30*1000

// 其它参数请参考 :https://doc.quickapp.cn/features/system/fetch.html

API

fetch.get(url, params, config)

fetch.post(url, data, config)

拦截器

fetch.requestUse(fulfilled, rejected)

fetch.responseUse(fulfilled, rejected)

Author

👤 M.Wang wangmin2@meizu.com

Show your support

Give a ⭐️ if this project helped you!

0.1.7

4 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.3

5 years ago

0.1.1

5 years ago

0.1.1-beta.1

5 years ago

0.1.1-beta.0

5 years ago