Created
August 22, 2021 16:18
-
-
Save kyanny/4f6d388c17dddf95d7f6ebbae09d0a66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
url = 'http://example.com?foo=1&bar=2' | |
uri = URI.parse(url) | |
decoded_query = URI.decode_www_form(uri.query) | |
pp decoded_query, decoded_query.class | |
decoded_query_hash = Hash[decoded_query] | |
pp decoded_query_hash, decoded_query_hash.class |
Author
kyanny
commented
Aug 22, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment