Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:05:56+00:00 2026-06-10T23:05:56+00:00

I am working with JMeter to write some performance tests. One of the things

  • 0

I am working with JMeter to write some performance tests. One of the things that I need to do is to construct a huge json request dynamically and send it as POST request paylod. Using BSF preprocessor, I am able to modify the payload dynamically however my javascript string is being encoded, while I want to send it without being encoded.

I am not sure how BSF preprocessor can stop it from being encoded. The command I currently use to change my POST request payload is as follows:

var jsonData = '[{"item":"value","something":"everything"}]';
sampler.addArgument("",jsonData);

I would really appreciate if you can point me to some examples which clearly explain how bsf preprocessors are expected to be used.

Any pointers to skip the encoding will also be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:05:57+00:00Added an answer on June 10, 2026 at 11:05 pm

    Since JMeter 2.6 you can use the RAW request pane using Post Body tab.

    So your solution is to do the following:

    1. In BSF Sampler, put you JSON in a variable:

      var jsonData = '[{"item":"value","something":"everything"}]';
      vars.putObject("jsonData",jsonData);
      
    2. In Post Body, put:

      ${jsonData}
      

    Another option using your method is to put in BSFPreProcessor using Beanshell language (not javascript):

    import org.apache.jmeter.protocol.http.util.HTTPArgument;
    String jsonData = "[{\"item\":\"value\",\"something\":\"everything\"}]";
    HTTPArgument arg =new HTTPArgument("", jsonData, null, true);
    arg.setAlwaysEncoded(false);
    sampler.getArguments().addArgument(arg);
    

    Regards

    Philippe M.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to exclude some URLs for a jMeter test: dont exclude: http://foo/bar/is/valid/with/this http://foo/bar/is/also/valid/with/that
I've read a few tutorials on jMeter RegEx extraction but it's not working. I'm
Working with an undisclosed API, I found a function that can set the number
Working with H2 I get this error when I try to write a row
Working on game where plates will be falling from top to bottom. Some plates
Working on an extension that use the new experimental devtools apis. How do you
Hello I'm working with Jmeter 2.4 and extended it creating a jmeter components jar,
I am just trying to extract json response data using jmeter but not able
Working with an API where I need to send a value over in an
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.