How to Send Byte Array in http request in Jmeter

前端 未结 2 1933
被撕碎了的回忆
被撕碎了的回忆 2021-01-20 18:59

I`m using j meter for load testing where I have to call upload Image API through http request and to achieve this I have to convert an image into compressed byte array to se

2条回答
  •  后悔当初
    2021-01-20 19:32

    Yes, I follow this method "add a Beanshell Pre Processor to your HTTP Request", and successful.

    For my case, I also add a "HTTP Header Manager", specify: "Content-Encoding:gzip", "Content-Type:"application/x-www-form-urlencoded", "Accept:/". And, set String encoding by: vars.put("binaryData", new String(binThrift, "ISO-8859-1"));

    HTTP Header Manager

    Beanshell Pre Processor

    HTTP Request

    Real Request

提交回复
热议问题