首页 文章

用于http响应头的Jmeter的正则表达式

提问于
浏览
0

如何使用正则表达式提取器从http-header响应中提取Etag?

我得到了以下输出,我希望提取 Etag 并在我的下一个案例中使用它,我将在 http-header 中传递它来做 If-None-Match . 我尝试了以下内容: \Etag:\s? 并在"Response Field to Check"中选择了"Headers" . 但我没有看到这个值发送到我的 Headers .

Thread Name: Fetch_Links 1-1
Sample Start: 2012-05-24 10:15:10 PDT
Load time: 135
Latency: 131
Size in bytes: 4950
Headers size in bytes: 641
Body size in bytes: 4309
Sample Count: 1
Error Count: 0
Response code: 200
Response message: OK

我正在使用2.6版本的jmeter . 先感谢您 .

1 回答

  • 1

    我能够使用以下参数在JMeter(正则表达式提取器 - Headers )中提取ETag:

    正则表达式:ETag:“( . *?)”

    模板:1美元

    然后添加HTTP标头管理器以使用“If-None-Match”传递Etag的值 .

相关问题