jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <Antony.Bowes...@williamhill.com.au>
Subject Why are HttpArguments always encoded?
Date Wed, 04 Jan 2017 06:32:51 GMT
I am using creating an HttpSamplerBase using the HttpSamplerFactory.

I have a JSON body I want to post, so I am adding

sampler.addArgument("", body);

However, this gets encoded, so I debugged the code and found that ALL arguments created via
HttpSamplerBase end up calling setAlwaysEncoded(true), so the JSON body gets encoded when
it's POSTed and there's no nice way to prevent this.

It looks like the only solution, which seems to be sort if how the UI creates the arguments,
is to create a new HttpArgument and set it's attributes and then do

sampler.getArguments().addArgument(arg);

Is this a built in limitation for some reason? It seems a rather clunky solution.

Why am I doing it this way - I have a major performance test framework I am porting to Jmeter
and I am implementing it using Java samplers with nested Http samplers, as it's the simplest
way to get this across in a short period of time.

Thanks
Antony




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message