1.0.0 • Published 2 years ago

ray-api v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

ray-api

author

ilex.h

useage

npm install ray-api

// web
import _Api from 'ray-api/lib/api';

// create instance
const Api = new _Api({
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json; charset=utf-8'
  }
});

export default Api;

// 使用
Api.get(url, {params, data}).then(res => res);
Api.head(url, {params, data}).then(res => res);
Api.post(url, {params, data}).then(res => res);
Api.del(url, {params, data}).then(res => res);
Api.put(url, {params, data}).then(res => res);
Api.options(url, {params, data}).then(res => res);
Api.patch(url, {params, data}).then(res => res);

API

props

nametypedefaultdescription
optsobject-请求参数

License

MIT

1.0.0

2 years ago