URL encoding HTTP get request

Continuing the discussion from Release 2.2.6 Available:

Rule-4.1:

  • Added URL Encode option for Send http GET and Send http POST. There is an overload of the % character between things like %device% and URL encoding, so the URL encoding is applied after those %device% substitutions are done. There is also a new action added to URL encode into a string variable.

I'm trying to use Rule Machine to send an HTTP get that includes a local variable string, but there are spaces in between the words that cause an error when sent as a URL. If the spaces can be URL encoded, then I think I should be able to send the HTTP get successfully.

I don't see an option in Rule Machine to do that as a part of the send HTTP get action, but the text quoted above from a set of platform release notes suggests to me that there should be an option to do this?

Did this option in RM change since then? I'm using the most recent version of RM, v. 5.1.

URL Encode is an option in Set variable, but not in the http GET action now.

1 Like

That did it, thanks.

I was able to set the variable to the string I needed, then URL encode the variable, which can then be added to the HTTP get action.

Wow. I have been challenged by this problem for years! Setting the variable with encode is the solution, and works GREAT for sending a string ie: "The works great"
Thanks!

1 Like