Uri.encode vs. uri-handler to_uri method
Well, when i'm trying to pass some difficult parameters to my get request, like a json:
http://myapisite.com/api/action?data={"username" : "test", "password" : "test", "domains" : [{"dname" : "test.com"}, {"dname" : "test.com"}], "subdomain" : "tt", "dns_server" : "ns1.test.com", "record_number" : "10"}
i noticed that Uri.encode does not cope with the transformation of ':' & '[]' characters, so, if you doesn't want retrieve an error like "Bad URL (not url)", i'll recommend you to use url-handler gem and it's method .to_uri
Written by Alex Lushpai
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#