How to make HTTP GET work?

I can't tell you what's going on. Both the URL Encode function for encoding into a String variable an in HTTP Get action use identical code. But, the problem may have been that you had over-encoded the URL.

URL encoding appears to be broken.

This works:
image

This does not:

image

Also, the HTTP response does not appear to be captured properly:

Well, at least you found a method that works. It's not that URL Encoding is broken, it's that the entire URL should not be URL Encoded. URL Encoding is a somewhat simple character substitution method. Probably the option to encode the entire URL should be removed.

Sounds like encoding just the special characters rather than the entire URL would fix the issue.

That's what it does, but encoding of http:// is most likely what broke it for you. This is a built-in Java Class, that does URL encode/decode. It's not broken, just its application against an entire url string, at least in your case. I've removed the option to do so in the next release, as simply encoding the portion of the URL that needs it into a String variable works, as you've determined.

An example of when you'd want to encode an entire URL is when you are sending an entire URL as part of another URL -- the embedded one needs to be encoded (Maker API uses this feature). But this is a different use than sending a Get.

I created a string variable named spaceEncoded with a value of %20 and now the following works:

1 Like

I'm having problems, could you show me how I need to put the GET url, I have this and its not working:

this is the original url without encode :
http://192.168.50.117/cgi-bin/configManager.cgi?action=setConfig&RecordMode[0].Mode=1

Just a thought, does

http://192.168.50.117/cgi-bin/configManager.cgi?action=setConfig&RecordMode.0.Mode=1

work?

I don't think you need to URL encode it.

i tried that, dose not work in the browser or RM

I don't know, special characters can cause fits, and it's never clear to my why or where that happens. Sorry I can't be more helpful, but I just don't know. RM simply passes the URL as entered to httpGet().

A post was merged into an existing topic: I found a bug!

Yes I know, see other thread you started. Please take this over there, not here.