用Jmeter发送二进制体

时间:2014-01-31 18:09:27

标签: jmeter protocol-buffers

我正在使用JMeter 2.10。 我正在寻找一种方法来发送带有HTTP请求的二进制POST主体(Protobuf有效载荷)。 要清楚 - 我没有上传文件。 也许有一种方法可以在Body Data textarea中编码字节码?

提前致谢!

3 个答案:

答案 0 :(得分:1)

在JMeter插件中尝试HTTP Raw Request sampler:http://jmeter-plugins.org/wiki/RawRequest/。您可以通过额外的JMeter插件获取它:http://jmeter-plugins.org/wiki/ExtrasSet/

答案 1 :(得分:0)

如果我正确地收到您的问题并且您需要在发送之前对数据进行URL编码,您可以将二进制数据包装到__urlencode函数

${__urlencode(A string containing weird characters like @ & * # and ")}

POST http://example.com/

POST data:
A+string+containing+weird+characters+like+%40+%26+*+%23+and+%22

或者,您可以使用任何合适的预处理器。其中最强大的是Beanshell,它提供对JMeter上下文和引擎的完全访问权限,并允许执行任意Beanshell(Java)代码。

答案 2 :(得分:-3)

JMeter也支持Protocol-buffers。您只需要在HTTP标头管理器中添加contentType = application / octet-stream。

enter image description here

感谢。 Atif Mehar

相关问题