1.0.4 • Published 5 years ago

damingerdai-rxhttp v1.0.4

Weekly downloads
8
License
Apache License
Repository
github
Last release
5 years ago

npm.io npm.io npm.io npm.io npm.io

rxhttp

基于rxjs和request的resfull api请求工具类,使用webpack打包

使用

下载

如果使用npm

npm install damingerdai-rxhttp -S

如果使用yarn

yarn add damingerdai-rxhttp

例子

const httpService = require('damingerdai-rxhttp').RxHttpService;
const perfixUrl = 'https://www.tianqiapi.com'
const http = new httpService();

const doFilter = (request) => {
    request.url = perfixUrl +  request.url
}

const filter = {
    doFilter:doFilter,
}

http.addFilter(filter);


const observable = http.get('/api', {
    version: 'v1',
    city: '上海',
});
observable.subscribe(res => {
    console.log(res);
})
1.0.4

5 years ago

1.0.3-beta1

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago