docs: update parser and custom script docs

This commit is contained in:
yukaidi
2026-06-10 21:23:05 +08:00
parent 6ae5d998e6
commit 0edc057347
7 changed files with 13 additions and 13 deletions

View File

@@ -240,13 +240,13 @@ var encoded = JsHttpClient.urlEncode("hello world"); // "hello%20world"
var decoded = JsHttpClient.urlDecode("hello%20world"); // "hello world"
// 发送简单表单数据
var formResponse = http.sendForm({
var formResponse = http.sendForm("https://api.example.com/login", {
username: "user",
password: "pass"
});
// 发送JSON数据
var jsonResponse = http.sendJson({
var jsonResponse = http.sendJson("https://api.example.com/submit", {
name: "test",
value: 123
});
@@ -637,7 +637,7 @@ A: 使用 `shareLinkInfo.getSharePassword()` 方法。
### Q: 如何处理需要登录的网盘?
A: 使用 `http.putHeader()` 设置认证头,或使用 `http.sendForm()` 发送登录表单。
A: 使用 `http.putHeader()` 设置认证头,或使用 `http.sendForm(url, data)` 发送登录表单。
### Q: 如何解析复杂的HTML

View File

@@ -68,7 +68,7 @@ List<FileInfo> files = tool.parseFileListSync();
```
要点:
- 必须先 WebClientVertxInit.init(Vertx)若未显式初始化,内部将懒加载 Vertx.vertx(),建议显式注入以统一生命周期
- 必须先 WebClientVertxInit.init(Vertx)未初始化时会直接报错,避免解析器偷偷创建第二个 Vert.x 实例
- 支持三种同步方法:
- `parseSync()`: 解析单个文件下载链接
- `parseFileListSync()`: 解析文件列表

View File

@@ -17,7 +17,7 @@
this.temporaryExecutor = WebClientVertxInit.get().createSharedWorkerExecutor(
"playground-temp-" + System.currentTimeMillis(),
1, // 每个请求只需要1个线程
10000000000L // 设置非常长的超时,避免被vertx强制中断
10000000000L // 设置非常长的超时,避免触发Vert.x阻塞线程告警
);
// 执行完成或超时后关闭

View File

@@ -106,7 +106,7 @@ executionFuture.toCompletionStage()
### 长期方案(需大量工作)
1. **迁移到GraalVM JavaScript引擎**
- 支持CPU时间限制
- 可以强制中断
- 相比Nashorn更容易实现受控取消
- 更好的性能
- 但需要额外依赖