简体   繁体   English

如何读取 jmeter 上的分块 HTTP 响应?

[英]How do I read chunked HTTP responses on jmeter?

I am using jmeter to send a HTTP POST request.我正在使用 jmeter 发送 HTTP POST 请求。 the server responds with a chunked http response 200 ok and I need to parse the initial chunk.服务器响应分块 http 响应 200 ok,我需要解析初始块。 However jmeter waits for all the response chunks.然而 jmeter 等待所有响应块。 I tried with the http sampler and http raw request sampler.我尝试使用 http 采样器和 http 原始请求采样器。 In both cases the chunks are not parsed individually.在这两种情况下,块都不会单独解析。

It can be achieved only by using JSR223 Sampler and custom Groovy scripting (or alternatively writing a brand new JMeter Plugin )它只能通过使用JSR223 Sampler和自定义Groovy 脚本来实现(或者编写一个全新的JMeter 插件

Example code you can use as the basis can be found in How do you read and print a chunked HTTP response using java.net.http as chunks arrive?您可以用作基础的示例代码可以在How do you read and print a chunked HTTP response using java.net.http as chunks到达? answer回答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM