jmeter modify json GET result and use in PUT

Viewed 2292

I'm using Jmeter to automate some tests cases. I have a JSON response from a GET, I want to change a single value of that JSON response and use the modified response in the body of a PUT. The PUT needs all the same fields as the response, and I won't know what they all are, so I don't think the JSON Path Extractor will work in my case. Efficiecy is a plus here, but I'll settle for something that just works.
I've tried this javascript in a BSF PostProcessor:

var response = SampleResult.getResponseDataAsString();
var jsonOutput = JSON.parse(response);
jsonOutput.configState = "DELETED";
vars.put("json",jsonOutput);

But the Debug Sampler shows the response as an "Object" and nothing more. Any ideas? Thanks.

1 Answers
Related