Put the non-encoded URL in a variable. Then use Set Variable with Replace to replace " " with "%20". Then use that variable in the HTTP Get action.
Or, change the encoded URL to use some substitute for %, such as ~, and put that in a variable. Then use replace for "~" to "%", and use that variable in the HTTP Get.
"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."
If I'm understanding correctly, the 'URL Encode' switch should be used when our URL contains a Hubitat variable? Are there other scenarios when we would need to use this switch?
If this is not correct, can we get a better explanation and possibly an example of how the 'URL Encode' switch works?
URL encoding and variables in strings are two different things. What you quoted is simply pointing out that the sequence of events is to first expand %variable-name%, and then URL encode the resulting string, when URL encoding of the entire URL is selected. Space characters and other special characters generally do not work in URLs, hence the need for URL encoding.
Maybe it's the head cold I'm fighting but this is still not clear.
'URL Encode' is a switch. Doesn't this mean the entire URL is always selected or can we highlight just a portion of the URL and then choose the 'URL Encode' switch?
Do you mean something like, "Hubitat doesn't gracefully handle URLs with special characters. Therefore, if your URL contains special characters, please use the 'URL Encode' switch. Additionally, since % is used for Hubitat variable substitution, please use the 'URL Encode' switch rather than manually encoding special characters. e.g. %24 for $."
Yeah, I think so. The problem was that putting things like %20 ...%20 in a url would collide with the use of %variable-name%, and the url would be trashed. That's why I said above that the variable substitution happens before the url encoding, so that the %variable-name% strings have all been converted to the variable values. The URL encoding will convert "10 Hour Lawnmower" to "10%20Hour%20Lawnmower", so you don't want to have %20 in the string before it is encoded.
Perhaps the action should display the url it's going to send.
But you can do it the same for the HTTP GET. So that the string put into the http get to get the response, is the same as the string without getting a response. Isn't the idea to find out what response you're getting?