porket-ajax

1.0.3 • Public • Published

porket-ajax

这是一个基于promise封装的ajax请求库,仅用于浏览器端

usasge

ajax(options);
 
try {
    let res =  await ajax({
        url: 'url',
        method: "get"
    })
    console.log(res);
}  catch(e) {
    console.error(e);
}

options

  • url: request url
  • method: request method
  • data: request data, data is json format

Package Sidebar

Install

npm i porket-ajax

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

4.22 kB

Total Files

6

Last publish

Collaborators

  • wangxunwei