Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/damingerdai/rxhttp
基于rxjs和request的http请求工具类
https://github.com/damingerdai/rxhttp
Last synced: 19 days ago
JSON representation
基于rxjs和request的http请求工具类
- Host: GitHub
- URL: https://github.com/damingerdai/rxhttp
- Owner: damingerdai
- License: apache-2.0
- Created: 2019-01-10T13:24:19.000Z (almost 6 years ago)
- Default Branch: develop
- Last Pushed: 2023-01-04T03:26:06.000Z (almost 2 years ago)
- Last Synced: 2024-11-10T07:26:46.687Z (about 2 months ago)
- Language: TypeScript
- Size: 727 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://img.shields.io/badge/rxhttp-200-blue.svg)
![](https://img.shields.io/github/license/damingerdai/rxhttp.svg?style=flat)
![](https://img.shields.io/github/last-commit/damingerdai/rxhttp.svg?style=flat)
![](https://img.shields.io/npm/v/damingerdai-rxhttp.svg?style=flat)
![](https://img.shields.io/npm/types/damingerdai-rxhttp.svg?style=flat)# 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);
})
```