要手动设置 HTTP 监控请求的 HTTP 版本,请将相应的代码添加到 HTTP 目标配置屏幕的 Scripts 选项卡下的 Prepare Script 文件中:
HTTP/1.1 //%DotcomWebComment% HttpClient.HttpVersion = System.Net.HttpVersion.Version11; //%DotcomWebComment% HttpClient.VersionPolicy = System.Net.Http.HttpVersionPolicy.RequestVersionExact;
HTTP/2.0 //%DotcomWebComment% HttpClient.HttpVersion = System.Net.HttpVersion.Version20; //%DotcomWebComment% HttpClient.VersionPolicy = System.Net.Http.HttpVersionPolicy.RequestVersionExact;
HTTP/3.0 //%DotcomWebComment% HttpClient.HttpVersion = System.Net.HttpVersion.Version30; //%DotcomWebComment% HttpClient.VersionPolicy = System.Net.Http.HttpVersionPolicy.RequestVersionExact;