fiddler查看content-encoding
时间: 2023-08-13 17:09:43 浏览: 45
要在 Fiddler 中查看 Content-Encoding,请按照以下步骤操作:
1. 打开 Fiddler,确保已经启动了代理服务器并且正在捕获请求和响应。
2. 在 Fiddler 中找到您要查看的请求或响应。
3. 在右侧的 Inspectors 标签中,选择 Headers 选项卡。
4. 在 Headers 部分中,查找 Content-Encoding 字段。
5. 如果 Content-Encoding 存在,则它将显示使用的压缩算法,例如 gzip 或 deflate。
6. 如果您想查看解压后的内容,请选择 Inspectors 标签中的 TextView 选项卡,并查看 Response 或者 Request Body 部分。
请注意,如果 Content-Encoding 字段不存在,则此请求或响应未经压缩。
相关问题
fiddler在FiddlerScript里面设置查看content-encoding
您可以通过以下代码在 FiddlerScript 中设置查看 content-encoding:
```
public static RulesOption("Decode Compressed Content")
var m_decodeCompressedContent: boolean = false;
static function OnBeforeResponse(oSession: Session) {
if (m_decodeCompressedContent && oSession.oResponse.headers.ExistsAndContains("Content-Encoding", "gzip")) {
oSession.utilDecodeResponse();
}
}
```
将以上代码添加到 FiddlerScript 中后,您可以启用或禁用“Decode Compressed Content”选项来查看经过压缩的内容。如果选项启用并且请求响应头中包含“Content-Encoding: gzip”,则 Fiddler 会自动解压缩响应体并将其显示在“Inspectors”选项卡中。
static function OnBeforeResponse(oSession: Session) { if (m_decodeCompressedContent && oSession.oResponse.headers.ExistsAndContains("Content-Encoding", "g zip")) { oSession.utilDecodeResponse();
这是 Fiddler 脚本中的一个函数,用于在 HTTP 响应返回前对其进行处理。具体来说,如果在 HTTP 响应头中找到了 "Content-Encoding" 属性,并且其值为 "gzip",那么就会对响应进行解压缩,以便于后续的处理。这个函数的作用是帮助开发者调试 HTTP 流量,通过解压缩 HTTP 响应,可以更好地观察和分析响应的内容。