# jzy-request-client

> 基于web fetch api封装的http 网络请求库

Latest version **1.0.5** (published 2021-05-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install jzy-request-client
pnpm add jzy-request-client
yarn add jzy-request-client
bun add jzy-request-client
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-05-20 |
| First published | 2020-09-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xljx |
| Maintainers | xljx |
| Keywords | http, retry, timeout |

## Links

- npm: https://www.npmjs.com/package/jzy-request-client
- Repository: http://192.168.8.111/commoncomponent/requestclient
- npm.io page: https://npm.io/package/jzy-request-client

## Dependencies (5)

- [json-bigint](https://npm.io/package/json-bigint.md) ^1.0.0
- [localforage](https://npm.io/package/localforage.md) ^1.8.1
- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) ^3.4.1
- [promise-polyfill](https://npm.io/package/promise-polyfill.md) 8.1.3
- [abortcontroller-polyfill](https://npm.io/package/abortcontroller-polyfill.md) ^1.5.0

## Recent versions

- 1.0.5 (latest) — 2021-05-20
- 1.0.3 — 2020-09-08

## README

## 配置

标准配置项：

- 默认禁用缓存；
- 默认禁用cookie；
- 默认允许重定向请求；
- 默认referrer 为完整的页面 url 地址；



扩展配置项：

- 请求间隔时间，默认0ms；
- 重试机制，默认不开启（如果开启重试机制，则请求以最后一次请求时间为准）；
- 撤销请求



##　标准Restful 支持

### Get

参数：

|      参数       |   说明   |      |
| :-------------: | :------: | :--: |
|       url       | 请求地址 |      |
|   requestData   |          |      |
|  headerOptions  |          |      |
| requestOptions  |          |      |
| abortController |          |      |











# Roadmap

### 1. 支持请求重试；
```text
    全局配置重试次数；
    单个接口配置；
```

### 2. 预设拦截器
```text
    日志拦截器；
    请求拦截器和响应拦截器支持同步/异步处理；
```

### 3. 支持实例化配置；

### 4. 代理检测
```text
    禁用系统代理
```

### 5. cookie 自动管理


### 6. 支持RxJs
```text
    RxJs 版超时机制；
    RxJs 版节流；
    RxJx 重试机制；
```

### 6. 支持合并请求



### 7.旧版本浏览器不受支持的API



URLSearchParams    https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams

Fetch 

Promise

AbortController

# 1.01
```text
更改打包配置
```
# 1.00
```text
正式支持超时配置、请求重试等重要功能
```
#0.0.5
添加请求防重机制

#0.0.3
```text
    1.更正请求参数设置错误；
    备注： 暂无足够资源测试接口逻辑是否完善，仅仅测试了 get 、
```
# 0.0.2

```text
    1. 预定义状态码
    2. web fetch API 
    3. 支持标准HTTP 请求方法；
    4. 支持超时机制（Promise.race（）实现）；
    5. 默认禁用cookie;
    
```

 # 0.0.1
```text
    基于axios（XMLHTTPRequest 实现） 封装常用请求；
```

---
_Source: https://npm.io/package/jzy-request-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
