Bug 63536 - JMeter support for vars.putObject binary post data and gzip post data
Summary: JMeter support for vars.putObject binary post data and gzip post data
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 5.1.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: JMETER_5.2
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-02 11:05 UTC by Liu XP
Modified: 2019-07-08 07:04 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liu XP 2019-07-02 11:05:22 UTC
Could JMeter support binary post data for following two cases
1. when using vars.putObject function to set arrary object data.
2. when using "Content-Encoding: gzip" in post request header the request body data could be compressed
Comment 1 Philippe Mouawad 2019-07-07 12:42:25 UTC
(In reply to Liu XP from comment #0)
> Could JMeter support binary post data for following two cases
> 1. when using vars.putObject function to set array object data.

I am not sure to understand, can you clarify what is currently not possible ?


> 2. when using "Content-Encoding: gzip" in post request header the request
> body data could be compressed

This duplicates Bug 58609
Comment 2 Liu XP 2019-07-08 07:04:10 UTC
For example:
The implementation source code of HTTP Client 4 in current master branch
jmeter\src\protocol\http\org\apache\jmeter\protocol\http\sampler\HTTPHC4Impl.java

The line 1587 below shows that all the post data will be converted to StringEntity first. Thus, the original post data format couldn't be used, such as ProtoBuff Msg.
StringEntity requestEntity = new StringEntity(postBody.toString(), contentEncoding);

For question 1:
I hope JMeter could support original post data format when the request included special content-type.
Because there is no judging condition about request content-encoding, all request will not be compressed.

For question 2:
I think following entity could be used to support gzipCompress.
HttpEntity entity = EntityBuilder.create().setText(postBody.toString()).gzipCompress().setContentEncoding(contentEncoding).build();