Skip to content

reqCharset

修改请求头 content-typecharset 部分,设置请求内容的编码。

content-type 结构:

txt
<media-type>; charset=<encoding>

规则语法

txt
pattern reqCharset://encoding [filters...]
参数描述详细文档
pattern匹配请求 URL 的表达式匹配模式文档
encoding编码名称,如 utf8
• 内联/内嵌/Values内容
⚠️ 不支持从文件/远程 URL 加载数据
filters可选过滤器,支持匹配:
• 请求URL/方法/头部/内容
• 响应状态码/头部
过滤器文档

配置示例

txt
# 设置请求编码,请求头 `content-type` 空字段被改成 `; charset=utf8`
www.example.com/path reqCharset://utf8

# 设置请求编码,请求头 `content-type` 空字段被改成 `text/html; charset=utf8`
www.example.com/path resType://json reqCharset://utf8

关联协议

  1. 直接修改请求头:reqHeaders://content-type=xxx
  2. 修改请求内容编码:reqType://media-type