curljmetergetgloburlencode

Turning globbing off in Jmeter


I'm trying to send a GET request that has bracket characters ('[]', '{}') in the query parameters which makes JMeter (v5.6.3) think I am trying to use globbing. I have been testing my API using Postman which showed me that I could turn of globbing with -g or --globoff. However, JMeter does not support this option as I found out here: https://jmeter.apache.org/usermanual/curl.html

The brackets are there because I am trying to send JSON objects in the query parameters. I unfortunately cannot change the API's method and put the JSON in the body. It HAS to be in the query parameters.

Is there a work around for unsupported options or a better way to send JSON objects in the query parameters?


Solution

  • Certain characters in URL need to be percent-encoded, in JMeter there is __urlencode() function which can do percent-encoding for you.

    Also given you're capable of running your request in Postman you should be able to record it using JMeter's HTTP(S) Test Script Recorder

    1. Configure Postman to use JMeter as the proxy

      enter image description here

    2. Import JMeter's certificate into Postman

      enter image description here

    3. Run your request in Postman -> JMeter will capture the request and generate appropriate HTTP Request sampler configuration

    More information: How to Convert Your Postman API Tests to JMeter for Scaling