Loadrunner - 在http响应中获取消息“未对Content-Type执行HTML解析”application / xml“”

问题描述 投票:0回答:1

我工作的服务器上的发送和接收内容是"application/xml"类型。

在我的init部分,我添加了以下行以自动添加到我的所有标头请求

web_add_auto_header("Content-Type","application/xml");

当我运行脚本时,我得到的响应标题显示正确的内容类型,但在boo day我收到消息:

351-byte response headers for "http://172.29.67.68/svc/bw/cti/monitor/event/bw_perfuser1000_60a439f7-599d-4fe1-baa6-598391312954" (RelFrameId=1, Internal ID=5)
 HTTP/1.1 200 OK\r\n
Date: Mon, 11 Mar 2019 18:20:09 GMT\r\n
Content-Length: 681\r\n
Content-Type: application/xml\r\n
X-Frame-Options: SAMEORIGIN\r\n
Expires: Thu, 01 Jan 1970 00:00:00 GMT\r\n
Cache-Control: no-cache, private, must-revalidate, max-stale=0, post-check=0, pre-check=0 
no-store\r\n
Pragma: no-cache\r\n
Keep-Alive: timeout=15, max=96\r\n
Connection: Keep-Alive\r\n

消息我得到:

HTML parsing not performed for Content-Type "application/xml" ("ParseHtmlContentType" Run-Time Setting is "TEXT").

要解决此问题,我需要在每个请求之前添加以下行

web_add_header("Content-Type","application/xml");

任何人都可以解释为什么我需要在每个请求之前明确提到内容类型,虽然我使用web_add_auto_header()函数。

谢谢先进,Ehud

http-headers loadrunner
1个回答
0
投票

在HTTP协议中,您需要HTTP请求中的特定请求标头字段。 HTTP Header的详细信息请参考wiki

© www.soinside.com 2019 - 2024. All rights reserved.