method
parse
v2_2_9 -
Show latest stable
- Class:
CGI
parse(query)public
Parse an HTTP query string into a hash of key=>value pairs.
params = CGI::parse("query_string") # {"name1" => ["value1", "value2", ...], # "name2" => ["value1", "value2", ...], ... }
1Note
See also: Rack::Utils.parse_nested_query.
Note that CGI::parse does not attempt to create a multi-level object; that is, it basically ignores hard brackets in key names.
For a method that does deal with these, see Rack::Utils.parse_nested_query.