@maiyunnet/kebab 9.15.6 → 9.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/kebab-rag.md +161 -78
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/core.d.ts +22 -3
- package/lib/core.js +23 -4
- package/lib/text.d.ts +6 -0
- package/lib/text.js +24 -1
- package/lib/undici/request.d.ts +6 -1
- package/lib/undici/request.js +8 -0
- package/lib/undici/response.d.ts +1 -1
- package/lib/undici/response.js +2 -1
- package/lib/undici.d.ts +7 -3
- package/lib/undici.js +48 -8
- package/package.json +1 -1
- package/sys/child.js +15 -12
- package/sys/ctr.js +3 -3
- package/sys/monitor/watchdog.js +9 -5
- package/sys/monitor.d.ts +8 -1
- package/sys/monitor.js +198 -81
- package/sys/route.d.ts +1 -1
- package/sys/route.js +14 -14
- package/www/example/ctr/test.d.ts +2 -0
- package/www/example/ctr/test.js +44 -3
package/doc/kebab-rag.md
CHANGED
|
@@ -1361,7 +1361,7 @@ index/variables/VER.md
|
|
|
1361
1361
|
|
|
1362
1362
|
# Variable: VER
|
|
1363
1363
|
|
|
1364
|
-
> `const` **VER**: `"9.
|
|
1364
|
+
> `const` **VER**: `"9.16.0"` = `'9.16.0'`
|
|
1365
1365
|
|
|
1366
1366
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1367
1367
|
|
|
@@ -3735,7 +3735,7 @@ lib/core/functions/loadEnv.md
|
|
|
3735
3735
|
|
|
3736
3736
|
> **loadEnv**(`dir`): `Promise`\<`void`\>
|
|
3737
3737
|
|
|
3738
|
-
Defined in: [lib/core.ts:
|
|
3738
|
+
Defined in: [lib/core.ts:1480](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1480)
|
|
3739
3739
|
|
|
3740
3740
|
加载 .env 文件到 process.env,若文件不存在则跳过
|
|
3741
3741
|
|
|
@@ -4210,7 +4210,7 @@ lib/core/functions/resolveEnvVars.md
|
|
|
4210
4210
|
|
|
4211
4211
|
> **resolveEnvVars**(`obj`): `void`
|
|
4212
4212
|
|
|
4213
|
-
Defined in: [lib/core.ts:
|
|
4213
|
+
Defined in: [lib/core.ts:1510](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1510)
|
|
4214
4214
|
|
|
4215
4215
|
将配置对象中的 ${ENV_VAR} 占位符替换为 process.env 的值
|
|
4216
4216
|
|
|
@@ -4652,7 +4652,13 @@ lib/core/functions/writeEventStreamHead.md
|
|
|
4652
4652
|
|
|
4653
4653
|
> **writeEventStreamHead**(`res`): `void`
|
|
4654
4654
|
|
|
4655
|
-
Defined in: [lib/core.ts:
|
|
4655
|
+
Defined in: [lib/core.ts:1450](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1450)
|
|
4656
|
+
|
|
4657
|
+
提交服务器发送事件(SSE)响应头
|
|
4658
|
+
|
|
4659
|
+
在发送第一条事件前调用一次,固定提交状态码 200、事件流内容类型和禁止缓存头部。
|
|
4660
|
+
SSE 的内容长度和结束时间未知,因此不设置 `content-length`;调用后响应头已经提交,
|
|
4661
|
+
不能再调用 `setHeader()`,后续应使用 `write()` 持续发送事件,并由调用方在结束时关闭响应。
|
|
4656
4662
|
|
|
4657
4663
|
## Parameters
|
|
4658
4664
|
|
|
@@ -4660,10 +4666,14 @@ Defined in: [lib/core.ts:1431](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
4660
4666
|
|
|
4661
4667
|
`Http2ServerResponse`\<`Http2ServerRequest`\> \| `ServerResponse`\<`IncomingMessage`\>
|
|
4662
4668
|
|
|
4669
|
+
响应对象
|
|
4670
|
+
|
|
4663
4671
|
## Returns
|
|
4664
4672
|
|
|
4665
4673
|
`void`
|
|
4666
4674
|
|
|
4675
|
+
无返回值
|
|
4676
|
+
|
|
4667
4677
|
lib/core/functions/writeHead.md
|
|
4668
4678
|
---
|
|
4669
4679
|
|
|
@@ -4677,9 +4687,16 @@ lib/core/functions/writeHead.md
|
|
|
4677
4687
|
|
|
4678
4688
|
> **writeHead**(`res`, `statusCode`, `headers?`): `void`
|
|
4679
4689
|
|
|
4680
|
-
Defined in: [lib/core.ts:
|
|
4690
|
+
Defined in: [lib/core.ts:1429](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1429)
|
|
4681
4691
|
|
|
4682
|
-
|
|
4692
|
+
提交 HTTP 响应状态和头部,兼容 HTTP/1.1 与 HTTP/2
|
|
4693
|
+
|
|
4694
|
+
`setHeader()` 只暂存或修改单个头部,不会发送响应头,也不能提交状态码;在响应头提交前可反复调用。
|
|
4695
|
+
本方法会立即提交状态码和此前设置的全部头部,必须在所有 `setHeader()` 调用之后、首次
|
|
4696
|
+
`write()`、`end()` 或 `pipe()` 之前调用。提交后再调用 `setHeader()` 会抛出 `ERR_HTTP_HEADERS_SENT`。
|
|
4697
|
+
|
|
4698
|
+
普通控制器应设置 `_httpCode`、调用 `_res.setHeader()` 并直接返回内容,由路由层统一提交响应头。
|
|
4699
|
+
仅框架内部或手动接管响应(错误、重定向、代理、流式输出等)时才应直接调用本方法。
|
|
4683
4700
|
|
|
4684
4701
|
## Parameters
|
|
4685
4702
|
|
|
@@ -4693,18 +4710,20 @@ Defined in: [lib/core.ts:1420](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
4693
4710
|
|
|
4694
4711
|
`number`
|
|
4695
4712
|
|
|
4696
|
-
状态码
|
|
4713
|
+
HTTP 状态码
|
|
4697
4714
|
|
|
4698
4715
|
### headers?
|
|
4699
4716
|
|
|
4700
4717
|
`OutgoingHttpHeaders`
|
|
4701
4718
|
|
|
4702
|
-
|
|
4719
|
+
随本次提交附加的头部;通常优先在提交前使用 `setHeader()`
|
|
4703
4720
|
|
|
4704
4721
|
## Returns
|
|
4705
4722
|
|
|
4706
4723
|
`void`
|
|
4707
4724
|
|
|
4725
|
+
无返回值
|
|
4726
|
+
|
|
4708
4727
|
lib/core/functions/write.md
|
|
4709
4728
|
---
|
|
4710
4729
|
|
|
@@ -4718,7 +4737,7 @@ lib/core/functions/write.md
|
|
|
4718
4737
|
|
|
4719
4738
|
> **write**(`res`, `data`): `void`
|
|
4720
4739
|
|
|
4721
|
-
Defined in: [lib/core.ts:
|
|
4740
|
+
Defined in: [lib/core.ts:1462](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1462)
|
|
4722
4741
|
|
|
4723
4742
|
向 res 发送数据
|
|
4724
4743
|
|
|
@@ -16550,7 +16569,7 @@ lib/text/functions/int2str.md
|
|
|
16550
16569
|
|
|
16551
16570
|
> **int2str**(`int`, `digits?`, `decimal?`): `string`
|
|
16552
16571
|
|
|
16553
|
-
Defined in: [lib/text.ts:
|
|
16572
|
+
Defined in: [lib/text.ts:825](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L825)
|
|
16554
16573
|
|
|
16555
16574
|
为解决精度问题,将整数转换为小数字符串
|
|
16556
16575
|
以下几个示例都是当 digits 为 3、decimal 为 2 时
|
|
@@ -16683,7 +16702,7 @@ lib/text/functions/isFalsy.md
|
|
|
16683
16702
|
|
|
16684
16703
|
> **isFalsy**(`val`): `val is TFalsy`
|
|
16685
16704
|
|
|
16686
|
-
Defined in: [lib/text.ts:
|
|
16705
|
+
Defined in: [lib/text.ts:776](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L776)
|
|
16687
16706
|
|
|
16688
16707
|
判断一个值是否是虚假的(为 null/undefined/空字符串/false/0)
|
|
16689
16708
|
|
|
@@ -16888,7 +16907,7 @@ lib/text/functions/isTruthy.md
|
|
|
16888
16907
|
|
|
16889
16908
|
> **isTruthy**\<`T`\>(`val`): `val is Exclude<T, TFalsy>`
|
|
16890
16909
|
|
|
16891
|
-
Defined in: [lib/text.ts:
|
|
16910
|
+
Defined in: [lib/text.ts:784](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L784)
|
|
16892
16911
|
|
|
16893
16912
|
判断一个值是否是真实的(不为 null/undefined/空字符串/false/0)
|
|
16894
16913
|
|
|
@@ -16923,7 +16942,7 @@ lib/text/functions/logicalOr.md
|
|
|
16923
16942
|
|
|
16924
16943
|
> **logicalOr**\<`T`, `T2`\>(`v1`, `v2`): `T` *extends* [`TFalsy`](../type-aliases/TFalsy.md) ? `T2` : `T`
|
|
16925
16944
|
|
|
16926
|
-
Defined in: [lib/text.ts:
|
|
16945
|
+
Defined in: [lib/text.ts:793](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L793)
|
|
16927
16946
|
|
|
16928
16947
|
类似 || 运算符的效果
|
|
16929
16948
|
|
|
@@ -17307,7 +17326,7 @@ lib/text/functions/str2int.md
|
|
|
17307
17326
|
|
|
17308
17327
|
> **str2int**(`str`, `digits?`): `number`
|
|
17309
17328
|
|
|
17310
|
-
Defined in: [lib/text.ts:
|
|
17329
|
+
Defined in: [lib/text.ts:807](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L807)
|
|
17311
17330
|
|
|
17312
17331
|
为解决精度问题,将字符串数字转换为整数显示
|
|
17313
17332
|
以下几个示例都是当 digits 为 2 时
|
|
@@ -17347,7 +17366,7 @@ lib/text/functions/stringifyBuffer.md
|
|
|
17347
17366
|
|
|
17348
17367
|
> **stringifyBuffer**(`buf`): `string`
|
|
17349
17368
|
|
|
17350
|
-
Defined in: [lib/text.ts:
|
|
17369
|
+
Defined in: [lib/text.ts:730](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L730)
|
|
17351
17370
|
|
|
17352
17371
|
输出文本格式的 buffer
|
|
17353
17372
|
|
|
@@ -17363,6 +17382,37 @@ Defined in: [lib/text.ts:706](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
17363
17382
|
|
|
17364
17383
|
`string`
|
|
17365
17384
|
|
|
17385
|
+
lib/text/functions/stringifyError.md
|
|
17386
|
+
---
|
|
17387
|
+
|
|
17388
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
17389
|
+
|
|
17390
|
+
***
|
|
17391
|
+
|
|
17392
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [lib/text](../index.md) / stringifyError
|
|
17393
|
+
|
|
17394
|
+
# Function: stringifyError()
|
|
17395
|
+
|
|
17396
|
+
> **stringifyError**(`error`): `string`
|
|
17397
|
+
|
|
17398
|
+
Defined in: [lib/text.ts:707](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L707)
|
|
17399
|
+
|
|
17400
|
+
将未知异常转换为适合单行日志的文本,Error 优先返回完整堆栈
|
|
17401
|
+
|
|
17402
|
+
## Parameters
|
|
17403
|
+
|
|
17404
|
+
### error
|
|
17405
|
+
|
|
17406
|
+
`unknown`
|
|
17407
|
+
|
|
17408
|
+
异常对象
|
|
17409
|
+
|
|
17410
|
+
## Returns
|
|
17411
|
+
|
|
17412
|
+
`string`
|
|
17413
|
+
|
|
17414
|
+
已转义的单行错误文本
|
|
17415
|
+
|
|
17366
17416
|
lib/text/functions/stringifyJson.md
|
|
17367
17417
|
---
|
|
17368
17418
|
|
|
@@ -17440,7 +17490,7 @@ lib/text/functions/trimJson.md
|
|
|
17440
17490
|
|
|
17441
17491
|
> **trimJson**(`json`): `any`
|
|
17442
17492
|
|
|
17443
|
-
Defined in: [lib/text.ts:
|
|
17493
|
+
Defined in: [lib/text.ts:738](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L738)
|
|
17444
17494
|
|
|
17445
17495
|
递归删除 json 中的字符串首尾空格,会返回一个新的对象
|
|
17446
17496
|
|
|
@@ -17580,6 +17630,7 @@ lib/text/index.md
|
|
|
17580
17630
|
- [sizeFormat](functions/sizeFormat.md)
|
|
17581
17631
|
- [str2int](functions/str2int.md)
|
|
17582
17632
|
- [stringifyBuffer](functions/stringifyBuffer.md)
|
|
17633
|
+
- [stringifyError](functions/stringifyError.md)
|
|
17583
17634
|
- [stringifyJson](functions/stringifyJson.md)
|
|
17584
17635
|
- [stringifyResult](functions/stringifyResult.md)
|
|
17585
17636
|
- [trimJson](functions/trimJson.md)
|
|
@@ -17646,7 +17697,7 @@ lib/text/type-aliases/TFalsy.md
|
|
|
17646
17697
|
|
|
17647
17698
|
> **TFalsy** = `false` \| `""` \| `0` \| `null` \| `undefined` \| *typeof* `NaN`
|
|
17648
17699
|
|
|
17649
|
-
Defined in: [lib/text.ts:
|
|
17700
|
+
Defined in: [lib/text.ts:770](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L770)
|
|
17650
17701
|
|
|
17651
17702
|
虚假值类型
|
|
17652
17703
|
|
|
@@ -18493,7 +18544,7 @@ lib/undici/functions/fetch.md
|
|
|
18493
18544
|
|
|
18494
18545
|
> **fetch**(`input`, `init?`): `Promise`\<`Response`\>
|
|
18495
18546
|
|
|
18496
|
-
Defined in: [lib/undici.ts:
|
|
18547
|
+
Defined in: [lib/undici.ts:243](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L243)
|
|
18497
18548
|
|
|
18498
18549
|
发起一个完全兼容 fetch 的请求
|
|
18499
18550
|
|
|
@@ -18528,7 +18579,7 @@ lib/undici/functions/filterHeaders.md
|
|
|
18528
18579
|
|
|
18529
18580
|
> **filterHeaders**(`headers`, `res?`, `filter?`): `Record`\<`string`, `string` \| `string`[]\>
|
|
18530
18581
|
|
|
18531
|
-
Defined in: [lib/undici.ts:
|
|
18582
|
+
Defined in: [lib/undici.ts:617](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L617)
|
|
18532
18583
|
|
|
18533
18584
|
剔除不代理的 header,返回新的 header
|
|
18534
18585
|
|
|
@@ -18569,7 +18620,7 @@ lib/undici/functions/getFormData.md
|
|
|
18569
18620
|
|
|
18570
18621
|
> **getFormData**(): [`FormData`](../formdata/classes/FormData.md)
|
|
18571
18622
|
|
|
18572
|
-
Defined in: [lib/undici.ts:
|
|
18623
|
+
Defined in: [lib/undici.ts:601](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L601)
|
|
18573
18624
|
|
|
18574
18625
|
创建 FormData 对象
|
|
18575
18626
|
|
|
@@ -18590,7 +18641,7 @@ lib/undici/functions/get.md
|
|
|
18590
18641
|
|
|
18591
18642
|
> **get**(`u`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
18592
18643
|
|
|
18593
|
-
Defined in: [lib/undici.ts:
|
|
18644
|
+
Defined in: [lib/undici.ts:123](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L123)
|
|
18594
18645
|
|
|
18595
18646
|
发起一个 get 请求
|
|
18596
18647
|
|
|
@@ -18652,7 +18703,7 @@ lib/undici/functions/getResponseJson.md
|
|
|
18652
18703
|
|
|
18653
18704
|
> **getResponseJson**(`u`, `opt?`): `Promise`\<`any`\>
|
|
18654
18705
|
|
|
18655
|
-
Defined in: [lib/undici.ts:
|
|
18706
|
+
Defined in: [lib/undici.ts:218](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L218)
|
|
18656
18707
|
|
|
18657
18708
|
发起 GET 请求并解析 JSON 响应
|
|
18658
18709
|
|
|
@@ -18689,7 +18740,7 @@ lib/undici/functions/mproxyData.md
|
|
|
18689
18740
|
|
|
18690
18741
|
> **mproxyData**(`ctr`): `any`
|
|
18691
18742
|
|
|
18692
|
-
Defined in: [lib/undici.ts:
|
|
18743
|
+
Defined in: [lib/undici.ts:719](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L719)
|
|
18693
18744
|
|
|
18694
18745
|
获取 mproxy 的附加数据
|
|
18695
18746
|
|
|
@@ -18718,7 +18769,7 @@ lib/undici/functions/mproxy.md
|
|
|
18718
18769
|
|
|
18719
18770
|
> **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
|
|
18720
18771
|
|
|
18721
|
-
Defined in: [lib/undici.ts:
|
|
18772
|
+
Defined in: [lib/undici.ts:657](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L657)
|
|
18722
18773
|
|
|
18723
18774
|
正向 mproxy 代理,注意提前处理不要自动处理 post 数据,读取 get 的 url 为实际请求地址
|
|
18724
18775
|
get: url, auth
|
|
@@ -18760,7 +18811,7 @@ lib/undici/functions/open.md
|
|
|
18760
18811
|
|
|
18761
18812
|
> **open**(`u`): [`Request`](../request/classes/Request.md)
|
|
18762
18813
|
|
|
18763
|
-
Defined in: [lib/undici.ts:
|
|
18814
|
+
Defined in: [lib/undici.ts:114](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L114)
|
|
18764
18815
|
|
|
18765
18816
|
创建一个请求对象
|
|
18766
18817
|
|
|
@@ -18787,7 +18838,7 @@ lib/undici/functions/postJson.md
|
|
|
18787
18838
|
|
|
18788
18839
|
> **postJson**(`u`, `data`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
18789
18840
|
|
|
18790
|
-
Defined in: [lib/undici.ts:
|
|
18841
|
+
Defined in: [lib/undici.ts:148](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L148)
|
|
18791
18842
|
|
|
18792
18843
|
发起 JSON 请求
|
|
18793
18844
|
|
|
@@ -18828,7 +18879,7 @@ lib/undici/functions/postJsonResponseJson.md
|
|
|
18828
18879
|
|
|
18829
18880
|
> **postJsonResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
|
|
18830
18881
|
|
|
18831
|
-
Defined in: [lib/undici.ts:
|
|
18882
|
+
Defined in: [lib/undici.ts:164](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L164)
|
|
18832
18883
|
|
|
18833
18884
|
发起 JSON 请求并解析 JSON 响应,失败时返回 null
|
|
18834
18885
|
|
|
@@ -18869,7 +18920,7 @@ lib/undici/functions/post.md
|
|
|
18869
18920
|
|
|
18870
18921
|
> **post**(`u`, `data`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
18871
18922
|
|
|
18872
|
-
Defined in: [lib/undici.ts:
|
|
18923
|
+
Defined in: [lib/undici.ts:133](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L133)
|
|
18873
18924
|
|
|
18874
18925
|
发起一个 post 请求
|
|
18875
18926
|
|
|
@@ -18910,7 +18961,7 @@ lib/undici/functions/postResponseJson.md
|
|
|
18910
18961
|
|
|
18911
18962
|
> **postResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
|
|
18912
18963
|
|
|
18913
|
-
Defined in: [lib/undici.ts:
|
|
18964
|
+
Defined in: [lib/undici.ts:192](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L192)
|
|
18914
18965
|
|
|
18915
18966
|
发起 POST 请求并解析 JSON 响应
|
|
18916
18967
|
|
|
@@ -18953,7 +19004,7 @@ lib/undici/functions/request.md
|
|
|
18953
19004
|
|
|
18954
19005
|
> **request**(`u`, `data?`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
18955
19006
|
|
|
18956
|
-
Defined in: [lib/undici.ts:
|
|
19007
|
+
Defined in: [lib/undici.ts:415](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L415)
|
|
18957
19008
|
|
|
18958
19009
|
发起一个请求
|
|
18959
19010
|
|
|
@@ -18990,7 +19041,7 @@ lib/undici/functions/rproxy.md
|
|
|
18990
19041
|
|
|
18991
19042
|
> **rproxy**(`ctr`, `route`, `opt?`): `Promise`\<`boolean`\>
|
|
18992
19043
|
|
|
18993
|
-
Defined in: [lib/undici.ts:
|
|
19044
|
+
Defined in: [lib/undici.ts:749](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L749)
|
|
18994
19045
|
|
|
18995
19046
|
反向代理,将本服务器的某个路由反代到其他网址
|
|
18996
19047
|
|
|
@@ -19079,7 +19130,7 @@ lib/undici/interfaces/IMproxyOptions.md
|
|
|
19079
19130
|
|
|
19080
19131
|
# Interface: IMproxyOptions
|
|
19081
19132
|
|
|
19082
|
-
Defined in: [lib/undici.ts:
|
|
19133
|
+
Defined in: [lib/undici.ts:870](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L870)
|
|
19083
19134
|
|
|
19084
19135
|
正向代理请求的传入参数选项
|
|
19085
19136
|
|
|
@@ -19089,7 +19140,7 @@ Defined in: [lib/undici.ts:820](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19089
19140
|
|
|
19090
19141
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
19091
19142
|
|
|
19092
|
-
Defined in: [lib/undici.ts:
|
|
19143
|
+
Defined in: [lib/undici.ts:879](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L879)
|
|
19093
19144
|
|
|
19094
19145
|
过滤 header,返回 true 则留下
|
|
19095
19146
|
|
|
@@ -19109,7 +19160,7 @@ Defined in: [lib/undici.ts:829](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19109
19160
|
|
|
19110
19161
|
> `optional` **follow?**: `number`
|
|
19111
19162
|
|
|
19112
|
-
Defined in: [lib/undici.ts:
|
|
19163
|
+
Defined in: [lib/undici.ts:873](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L873)
|
|
19113
19164
|
|
|
19114
19165
|
***
|
|
19115
19166
|
|
|
@@ -19117,7 +19168,7 @@ Defined in: [lib/undici.ts:823](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19117
19168
|
|
|
19118
19169
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19119
19170
|
|
|
19120
|
-
Defined in: [lib/undici.ts:
|
|
19171
|
+
Defined in: [lib/undici.ts:877](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L877)
|
|
19121
19172
|
|
|
19122
19173
|
***
|
|
19123
19174
|
|
|
@@ -19125,7 +19176,7 @@ Defined in: [lib/undici.ts:827](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19125
19176
|
|
|
19126
19177
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19127
19178
|
|
|
19128
|
-
Defined in: [lib/undici.ts:
|
|
19179
|
+
Defined in: [lib/undici.ts:875](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L875)
|
|
19129
19180
|
|
|
19130
19181
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19131
19182
|
|
|
@@ -19135,7 +19186,7 @@ Defined in: [lib/undici.ts:825](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19135
19186
|
|
|
19136
19187
|
> `optional` **local?**: `string`
|
|
19137
19188
|
|
|
19138
|
-
Defined in: [lib/undici.ts:
|
|
19189
|
+
Defined in: [lib/undici.ts:876](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L876)
|
|
19139
19190
|
|
|
19140
19191
|
***
|
|
19141
19192
|
|
|
@@ -19143,7 +19194,7 @@ Defined in: [lib/undici.ts:826](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19143
19194
|
|
|
19144
19195
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19145
19196
|
|
|
19146
|
-
Defined in: [lib/undici.ts:
|
|
19197
|
+
Defined in: [lib/undici.ts:881](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L881)
|
|
19147
19198
|
|
|
19148
19199
|
默认为 default
|
|
19149
19200
|
|
|
@@ -19153,7 +19204,7 @@ Defined in: [lib/undici.ts:831](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19153
19204
|
|
|
19154
19205
|
> `optional` **timeout?**: `number`
|
|
19155
19206
|
|
|
19156
|
-
Defined in: [lib/undici.ts:
|
|
19207
|
+
Defined in: [lib/undici.ts:872](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L872)
|
|
19157
19208
|
|
|
19158
19209
|
秒数,默认 300 秒
|
|
19159
19210
|
|
|
@@ -19168,7 +19219,7 @@ lib/undici/interfaces/IRequestOptions.md
|
|
|
19168
19219
|
|
|
19169
19220
|
# Interface: IRequestOptions
|
|
19170
19221
|
|
|
19171
|
-
Defined in: [lib/undici.ts:
|
|
19222
|
+
Defined in: [lib/undici.ts:835](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L835)
|
|
19172
19223
|
|
|
19173
19224
|
请求的传入参数选项
|
|
19174
19225
|
|
|
@@ -19178,7 +19229,7 @@ Defined in: [lib/undici.ts:787](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19178
19229
|
|
|
19179
19230
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
19180
19231
|
|
|
19181
|
-
Defined in: [lib/undici.ts:
|
|
19232
|
+
Defined in: [lib/undici.ts:862](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L862)
|
|
19182
19233
|
|
|
19183
19234
|
cookie 托管对象
|
|
19184
19235
|
|
|
@@ -19188,7 +19239,7 @@ cookie 托管对象
|
|
|
19188
19239
|
|
|
19189
19240
|
> `optional` **follow?**: `number`
|
|
19190
19241
|
|
|
19191
|
-
Defined in: [lib/undici.ts:
|
|
19242
|
+
Defined in: [lib/undici.ts:843](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L843)
|
|
19192
19243
|
|
|
19193
19244
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
19194
19245
|
|
|
@@ -19198,7 +19249,7 @@ Defined in: [lib/undici.ts:793](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19198
19249
|
|
|
19199
19250
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19200
19251
|
|
|
19201
|
-
Defined in: [lib/undici.ts:
|
|
19252
|
+
Defined in: [lib/undici.ts:848](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L848)
|
|
19202
19253
|
|
|
19203
19254
|
***
|
|
19204
19255
|
|
|
@@ -19206,7 +19257,7 @@ Defined in: [lib/undici.ts:798](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19206
19257
|
|
|
19207
19258
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19208
19259
|
|
|
19209
|
-
Defined in: [lib/undici.ts:
|
|
19260
|
+
Defined in: [lib/undici.ts:845](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L845)
|
|
19210
19261
|
|
|
19211
19262
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19212
19263
|
|
|
@@ -19216,7 +19267,7 @@ Defined in: [lib/undici.ts:795](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19216
19267
|
|
|
19217
19268
|
> `optional` **keep?**: `boolean`
|
|
19218
19269
|
|
|
19219
|
-
Defined in: [lib/undici.ts:
|
|
19270
|
+
Defined in: [lib/undici.ts:858](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L858)
|
|
19220
19271
|
|
|
19221
19272
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
19222
19273
|
|
|
@@ -19226,7 +19277,7 @@ Defined in: [lib/undici.ts:808](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19226
19277
|
|
|
19227
19278
|
> `optional` **local?**: `string`
|
|
19228
19279
|
|
|
19229
|
-
Defined in: [lib/undici.ts:
|
|
19280
|
+
Defined in: [lib/undici.ts:847](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L847)
|
|
19230
19281
|
|
|
19231
19282
|
***
|
|
19232
19283
|
|
|
@@ -19234,7 +19285,7 @@ Defined in: [lib/undici.ts:797](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19234
19285
|
|
|
19235
19286
|
> `optional` **log?**: `boolean`
|
|
19236
19287
|
|
|
19237
|
-
Defined in: [lib/undici.ts:
|
|
19288
|
+
Defined in: [lib/undici.ts:864](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L864)
|
|
19238
19289
|
|
|
19239
19290
|
若有异常写入文件日志,默认为 true
|
|
19240
19291
|
|
|
@@ -19244,7 +19295,7 @@ Defined in: [lib/undici.ts:814](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19244
19295
|
|
|
19245
19296
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
19246
19297
|
|
|
19247
|
-
Defined in: [lib/undici.ts:
|
|
19298
|
+
Defined in: [lib/undici.ts:836](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L836)
|
|
19248
19299
|
|
|
19249
19300
|
***
|
|
19250
19301
|
|
|
@@ -19252,7 +19303,7 @@ Defined in: [lib/undici.ts:788](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19252
19303
|
|
|
19253
19304
|
> `optional` **mproxy?**: `object`
|
|
19254
19305
|
|
|
19255
|
-
Defined in: [lib/undici.ts:
|
|
19306
|
+
Defined in: [lib/undici.ts:850](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L850)
|
|
19256
19307
|
|
|
19257
19308
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
19258
19309
|
|
|
@@ -19276,11 +19327,21 @@ Defined in: [lib/undici.ts:800](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19276
19327
|
|
|
19277
19328
|
***
|
|
19278
19329
|
|
|
19330
|
+
### retry?
|
|
19331
|
+
|
|
19332
|
+
> `optional` **retry?**: `number`
|
|
19333
|
+
|
|
19334
|
+
Defined in: [lib/undici.ts:841](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L841)
|
|
19335
|
+
|
|
19336
|
+
网络异常后的重试次数,默认 0;流式请求体不可重试,非幂等请求需由调用方保证安全
|
|
19337
|
+
|
|
19338
|
+
***
|
|
19339
|
+
|
|
19279
19340
|
### reuse?
|
|
19280
19341
|
|
|
19281
19342
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19282
19343
|
|
|
19283
|
-
Defined in: [lib/undici.ts:
|
|
19344
|
+
Defined in: [lib/undici.ts:860](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L860)
|
|
19284
19345
|
|
|
19285
19346
|
复用池名/Agent,默认为 default
|
|
19286
19347
|
|
|
@@ -19290,7 +19351,7 @@ Defined in: [lib/undici.ts:810](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19290
19351
|
|
|
19291
19352
|
> `optional` **save?**: `string`
|
|
19292
19353
|
|
|
19293
|
-
Defined in: [lib/undici.ts:
|
|
19354
|
+
Defined in: [lib/undici.ts:846](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L846)
|
|
19294
19355
|
|
|
19295
19356
|
***
|
|
19296
19357
|
|
|
@@ -19298,7 +19359,7 @@ Defined in: [lib/undici.ts:796](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19298
19359
|
|
|
19299
19360
|
> `optional` **signal?**: `AbortSignal`
|
|
19300
19361
|
|
|
19301
|
-
Defined in: [lib/undici.ts:
|
|
19362
|
+
Defined in: [lib/undici.ts:866](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L866)
|
|
19302
19363
|
|
|
19303
19364
|
请求中止信号
|
|
19304
19365
|
|
|
@@ -19308,7 +19369,7 @@ Defined in: [lib/undici.ts:816](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19308
19369
|
|
|
19309
19370
|
> `optional` **timeout?**: `number`
|
|
19310
19371
|
|
|
19311
|
-
Defined in: [lib/undici.ts:
|
|
19372
|
+
Defined in: [lib/undici.ts:839](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L839)
|
|
19312
19373
|
|
|
19313
19374
|
秒数,默认 300 秒
|
|
19314
19375
|
|
|
@@ -19318,7 +19379,7 @@ Defined in: [lib/undici.ts:791](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19318
19379
|
|
|
19319
19380
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
19320
19381
|
|
|
19321
|
-
Defined in: [lib/undici.ts:
|
|
19382
|
+
Defined in: [lib/undici.ts:837](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L837)
|
|
19322
19383
|
|
|
19323
19384
|
lib/undici/interfaces/IRproxyOptions.md
|
|
19324
19385
|
---
|
|
@@ -19331,7 +19392,7 @@ lib/undici/interfaces/IRproxyOptions.md
|
|
|
19331
19392
|
|
|
19332
19393
|
# Interface: IRproxyOptions
|
|
19333
19394
|
|
|
19334
|
-
Defined in: [lib/undici.ts:
|
|
19395
|
+
Defined in: [lib/undici.ts:885](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L885)
|
|
19335
19396
|
|
|
19336
19397
|
反向代理请求的传入参数选项
|
|
19337
19398
|
|
|
@@ -19341,7 +19402,7 @@ Defined in: [lib/undici.ts:835](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19341
19402
|
|
|
19342
19403
|
> `optional` **body?**: `string` \| `Buffer`\<`ArrayBufferLike`\> \| `Readable`
|
|
19343
19404
|
|
|
19344
|
-
Defined in: [lib/undici.ts:
|
|
19405
|
+
Defined in: [lib/undici.ts:904](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L904)
|
|
19345
19406
|
|
|
19346
19407
|
手动传入请求体(优先于原始 req 流),用于 req 流已消费后仍需转发 body 的场景
|
|
19347
19408
|
|
|
@@ -19351,7 +19412,7 @@ Defined in: [lib/undici.ts:854](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19351
19412
|
|
|
19352
19413
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
19353
19414
|
|
|
19354
|
-
Defined in: [lib/undici.ts:
|
|
19415
|
+
Defined in: [lib/undici.ts:894](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L894)
|
|
19355
19416
|
|
|
19356
19417
|
过滤 header,返回 true 则留下
|
|
19357
19418
|
|
|
@@ -19371,7 +19432,7 @@ Defined in: [lib/undici.ts:844](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19371
19432
|
|
|
19372
19433
|
> `optional` **follow?**: `number`
|
|
19373
19434
|
|
|
19374
|
-
Defined in: [lib/undici.ts:
|
|
19435
|
+
Defined in: [lib/undici.ts:888](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L888)
|
|
19375
19436
|
|
|
19376
19437
|
***
|
|
19377
19438
|
|
|
@@ -19379,7 +19440,7 @@ Defined in: [lib/undici.ts:838](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19379
19440
|
|
|
19380
19441
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19381
19442
|
|
|
19382
|
-
Defined in: [lib/undici.ts:
|
|
19443
|
+
Defined in: [lib/undici.ts:892](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L892)
|
|
19383
19444
|
|
|
19384
19445
|
***
|
|
19385
19446
|
|
|
@@ -19387,7 +19448,7 @@ Defined in: [lib/undici.ts:842](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19387
19448
|
|
|
19388
19449
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19389
19450
|
|
|
19390
|
-
Defined in: [lib/undici.ts:
|
|
19451
|
+
Defined in: [lib/undici.ts:890](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L890)
|
|
19391
19452
|
|
|
19392
19453
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19393
19454
|
|
|
@@ -19397,7 +19458,7 @@ Defined in: [lib/undici.ts:840](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19397
19458
|
|
|
19398
19459
|
> `optional` **local?**: `string`
|
|
19399
19460
|
|
|
19400
|
-
Defined in: [lib/undici.ts:
|
|
19461
|
+
Defined in: [lib/undici.ts:891](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L891)
|
|
19401
19462
|
|
|
19402
19463
|
***
|
|
19403
19464
|
|
|
@@ -19405,7 +19466,7 @@ Defined in: [lib/undici.ts:841](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19405
19466
|
|
|
19406
19467
|
> `optional` **mproxy?**: `object`
|
|
19407
19468
|
|
|
19408
|
-
Defined in: [lib/undici.ts:
|
|
19469
|
+
Defined in: [lib/undici.ts:896](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L896)
|
|
19409
19470
|
|
|
19410
19471
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
19411
19472
|
|
|
@@ -19433,7 +19494,7 @@ Defined in: [lib/undici.ts:846](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19433
19494
|
|
|
19434
19495
|
> `optional` **querys?**: `Record`\<`string`, `any`\>
|
|
19435
19496
|
|
|
19436
|
-
Defined in: [lib/undici.ts:
|
|
19497
|
+
Defined in: [lib/undici.ts:906](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L906)
|
|
19437
19498
|
|
|
19438
19499
|
自定义 GET 查询参数,传入后直接替换代理目标 URL 的整个 query string
|
|
19439
19500
|
|
|
@@ -19443,7 +19504,7 @@ Defined in: [lib/undici.ts:856](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19443
19504
|
|
|
19444
19505
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19445
19506
|
|
|
19446
|
-
Defined in: [lib/undici.ts:
|
|
19507
|
+
Defined in: [lib/undici.ts:908](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L908)
|
|
19447
19508
|
|
|
19448
19509
|
默认为 default
|
|
19449
19510
|
|
|
@@ -19453,7 +19514,7 @@ Defined in: [lib/undici.ts:858](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19453
19514
|
|
|
19454
19515
|
> `optional` **timeout?**: `number`
|
|
19455
19516
|
|
|
19456
|
-
Defined in: [lib/undici.ts:
|
|
19517
|
+
Defined in: [lib/undici.ts:887](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L887)
|
|
19457
19518
|
|
|
19458
19519
|
秒数,默认 300 秒
|
|
19459
19520
|
|
|
@@ -19516,7 +19577,7 @@ Defined in: [lib/undici/request.ts:30](https://github.com/maiyunnet/kebab/blob/m
|
|
|
19516
19577
|
|
|
19517
19578
|
> **follow**(`follow?`): `this`
|
|
19518
19579
|
|
|
19519
|
-
Defined in: [lib/undici/request.ts:
|
|
19580
|
+
Defined in: [lib/undici/request.ts:96](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L96)
|
|
19520
19581
|
|
|
19521
19582
|
设置是否跟随请求方的 location,留空为跟随,不设置为不跟随
|
|
19522
19583
|
|
|
@@ -19550,7 +19611,7 @@ method get 方法别名
|
|
|
19550
19611
|
|
|
19551
19612
|
> **headers**(`headers`): `this`
|
|
19552
19613
|
|
|
19553
|
-
Defined in: [lib/undici/request.ts:
|
|
19614
|
+
Defined in: [lib/undici/request.ts:132](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L132)
|
|
19554
19615
|
|
|
19555
19616
|
批量设置提交的 headers
|
|
19556
19617
|
|
|
@@ -19570,7 +19631,7 @@ Defined in: [lib/undici/request.ts:123](https://github.com/maiyunnet/kebab/blob/
|
|
|
19570
19631
|
|
|
19571
19632
|
> **hosts**(`hosts`): `this`
|
|
19572
19633
|
|
|
19573
|
-
Defined in: [lib/undici/request.ts:
|
|
19634
|
+
Defined in: [lib/undici/request.ts:105](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L105)
|
|
19574
19635
|
|
|
19575
19636
|
设置域名 -> ip的对应键值,就像电脑里的 hosts 一样
|
|
19576
19637
|
|
|
@@ -19604,7 +19665,7 @@ type json 方法别名
|
|
|
19604
19665
|
|
|
19605
19666
|
> **local**(`addr`): `this`
|
|
19606
19667
|
|
|
19607
|
-
Defined in: [lib/undici/request.ts:
|
|
19668
|
+
Defined in: [lib/undici/request.ts:123](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L123)
|
|
19608
19669
|
|
|
19609
19670
|
设置使用的本地网卡 IP
|
|
19610
19671
|
|
|
@@ -19658,7 +19719,7 @@ method post 方法别名
|
|
|
19658
19719
|
|
|
19659
19720
|
> **request**(`cookie?`): `Promise`\<[`Response`](../../response/classes/Response.md)\>
|
|
19660
19721
|
|
|
19661
|
-
Defined in: [lib/undici/request.ts:
|
|
19722
|
+
Defined in: [lib/undici/request.ts:152](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L152)
|
|
19662
19723
|
|
|
19663
19724
|
发起请求
|
|
19664
19725
|
|
|
@@ -19674,11 +19735,33 @@ Defined in: [lib/undici/request.ts:143](https://github.com/maiyunnet/kebab/blob/
|
|
|
19674
19735
|
|
|
19675
19736
|
***
|
|
19676
19737
|
|
|
19738
|
+
### retry()
|
|
19739
|
+
|
|
19740
|
+
> **retry**(`retry?`): `this`
|
|
19741
|
+
|
|
19742
|
+
Defined in: [lib/undici/request.ts:87](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L87)
|
|
19743
|
+
|
|
19744
|
+
设置网络异常后的重试次数
|
|
19745
|
+
|
|
19746
|
+
#### Parameters
|
|
19747
|
+
|
|
19748
|
+
##### retry?
|
|
19749
|
+
|
|
19750
|
+
`number` = `1`
|
|
19751
|
+
|
|
19752
|
+
重试次数,默认为 1;非幂等请求需由调用方保证安全
|
|
19753
|
+
|
|
19754
|
+
#### Returns
|
|
19755
|
+
|
|
19756
|
+
`this`
|
|
19757
|
+
|
|
19758
|
+
***
|
|
19759
|
+
|
|
19677
19760
|
### save()
|
|
19678
19761
|
|
|
19679
19762
|
> **save**(`save`): `this`
|
|
19680
19763
|
|
|
19681
|
-
Defined in: [lib/undici/request.ts:
|
|
19764
|
+
Defined in: [lib/undici/request.ts:114](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L114)
|
|
19682
19765
|
|
|
19683
19766
|
设置后将直接保存到本地文件,不会返回,save 为本地实体路径
|
|
19684
19767
|
|
|
@@ -19698,7 +19781,7 @@ Defined in: [lib/undici/request.ts:105](https://github.com/maiyunnet/kebab/blob/
|
|
|
19698
19781
|
|
|
19699
19782
|
> **setHeader**(`name`, `val`): `this`
|
|
19700
19783
|
|
|
19701
|
-
Defined in: [lib/undici/request.ts:
|
|
19784
|
+
Defined in: [lib/undici/request.ts:142](https://github.com/maiyunnet/kebab/blob/master/lib/undici/request.ts#L142)
|
|
19702
19785
|
|
|
19703
19786
|
设置单条 header
|
|
19704
19787
|
|
|
@@ -19842,7 +19925,7 @@ Defined in: [lib/undici/response.ts:33](https://github.com/maiyunnet/kebab/blob/
|
|
|
19842
19925
|
|
|
19843
19926
|
> **getJson**(): `Promise`\<`any`\>
|
|
19844
19927
|
|
|
19845
|
-
Defined in: [lib/undici/response.ts:
|
|
19928
|
+
Defined in: [lib/undici/response.ts:67](https://github.com/maiyunnet/kebab/blob/master/lib/undici/response.ts#L67)
|
|
19846
19929
|
|
|
19847
19930
|
读取所有内容为 JSON,失败返回 null
|
|
19848
19931
|
|
|
@@ -19856,7 +19939,7 @@ Defined in: [lib/undici/response.ts:66](https://github.com/maiyunnet/kebab/blob/
|
|
|
19856
19939
|
|
|
19857
19940
|
> **getRawStream**(): `BodyReadable` & `BodyMixin` \| `null`
|
|
19858
19941
|
|
|
19859
|
-
Defined in: [lib/undici/response.ts:
|
|
19942
|
+
Defined in: [lib/undici/response.ts:127](https://github.com/maiyunnet/kebab/blob/master/lib/undici/response.ts#L127)
|
|
19860
19943
|
|
|
19861
19944
|
获取原生响应读取流对象
|
|
19862
19945
|
|
|
@@ -19870,7 +19953,7 @@ Defined in: [lib/undici/response.ts:126](https://github.com/maiyunnet/kebab/blob
|
|
|
19870
19953
|
|
|
19871
19954
|
> **getStream**(): `BrotliDecompress` \| `Gunzip` \| `Inflate` \| `BodyReadable` & `BodyMixin` \| `null`
|
|
19872
19955
|
|
|
19873
|
-
Defined in: [lib/undici/response.ts:
|
|
19956
|
+
Defined in: [lib/undici/response.ts:92](https://github.com/maiyunnet/kebab/blob/master/lib/undici/response.ts#L92)
|
|
19874
19957
|
|
|
19875
19958
|
获取响应读取流对象
|
|
19876
19959
|
|
|
@@ -19884,7 +19967,7 @@ Defined in: [lib/undici/response.ts:91](https://github.com/maiyunnet/kebab/blob/
|
|
|
19884
19967
|
|
|
19885
19968
|
> **getText**(): `Promise`\<`string` \| `null`\>
|
|
19886
19969
|
|
|
19887
|
-
Defined in: [lib/undici/response.ts:
|
|
19970
|
+
Defined in: [lib/undici/response.ts:52](https://github.com/maiyunnet/kebab/blob/master/lib/undici/response.ts#L52)
|
|
19888
19971
|
|
|
19889
19972
|
读取所有内容为文本
|
|
19890
19973
|
|
|
@@ -19898,7 +19981,7 @@ Defined in: [lib/undici/response.ts:51](https://github.com/maiyunnet/kebab/blob/
|
|
|
19898
19981
|
|
|
19899
19982
|
> **setContent**(`v`): `void`
|
|
19900
19983
|
|
|
19901
|
-
Defined in: [lib/undici/response.ts:
|
|
19984
|
+
Defined in: [lib/undici/response.ts:85](https://github.com/maiyunnet/kebab/blob/master/lib/undici/response.ts#L85)
|
|
19902
19985
|
|
|
19903
19986
|
用户自定义的 content 内容
|
|
19904
19987
|
|
|
@@ -19942,7 +20025,7 @@ lib/undici/type-aliases/THttpHeaders.md
|
|
|
19942
20025
|
|
|
19943
20026
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
19944
20027
|
|
|
19945
|
-
Defined in: [lib/undici.ts:
|
|
20028
|
+
Defined in: [lib/undici.ts:913](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L913)
|
|
19946
20029
|
|
|
19947
20030
|
http headers
|
|
19948
20031
|
|