1

I have an API which it's URL requires a string with spaces --> A B C I have tried

String X = "A B C";
vars.put("myKey",X);

GET  https://myserver.com/Api/v1.0/config/${myKey}   

When JMeter executes this it replaces spaces with %20 in url. I do not want JMeter to repalces spaces with %20, how can I do that

GET https://myserver.com/Api/v1.0/config/A%20B%20C
user7294900
  • 52,490
  • 20
  • 92
  • 189
Ghost
  • 489
  • 4
  • 20

2 Answers2

1

You can't send space in URL:

A URL must not contain a literal space. It must either be encoded using the percent-encoding or a different encoding that uses URL-safe characters (like application/x-www-form-urlencoded that uses + instead of %20 for spaces).

But you can use + instead of space

And notice that server/receiving end will decode it back to spaces so there isn't a real issue.

Community
  • 1
  • 1
user7294900
  • 52,490
  • 20
  • 92
  • 189
1

Usually browser replaces spaces entered into the address bar with %20. So do JMeter.

You have to update your API, so URL param with %20 should be interpreted as a string with a space(s) by your API.

Vadim Yangunaev
  • 1,623
  • 1
  • 17
  • 35