docs/docs/rules/reqHeaders.md
动态修改请求头部信息,支持多种数据源和批量操作方式。
pattern reqHeaders://value [filters...]
| 参数 | 描述 | 详细文档 |
|---|---|---|
| pattern | 匹配请求 URL 的表达式 | 匹配模式文档 |
| value | 操作数据对象,支持从以下渠道获取: | |
| • 目录/文件路径 | ||
| • 远程 URL | ||
| • 内联/内嵌/Values内容 | 操作指令文档 | |
| filters | 可选过滤器,支持匹配: | |
| • 请求URL/方法/头部/内容 | ||
| • 响应状态码/头部 | 过滤器文档 |
www.example.com/path reqHeaders://x-proxy=Whistle
访问 https://www.example.com/path/to 在 Whistle Network 或后台服务器可以看到新增请求头:
x-proxy: Whistle
``` test.json
x-test1: 1
x-test2:
x-test3: abc
```
www.example.com/path2 reqHeaders://{test.json}
# 等价于:www.example.com/path2 reqHeaders://x-test1=1&x-test2=&x-test3=abc
访问 https://www.example.com/path2/to 在 Whistle Network 或后台服务器可以看到新增请求头:
x-test1: 1
x-test2:
x-test3: abc
www.example.com/path1 reqHeaders:///User/xxx/test.json
www.example.com/path2 reqHeaders://https://www.xxx.com/xxx/params.json
# 通过编辑临时文件
www.example.com/path3 reqHeaders://temp/blank.json
Delete Request Header):delete://reqHeaders.xxxDelete Request Cookie):delete://reqCookies.xxx