欢迎来到cool的博客
7

Music box

Click to Start

点击头像播放音乐
新博客链接

How Does Rack Parse Query Params? With Parse_nested_query

irb(main):018:0> query = "filters[colour][]=Red&filters[colour][]=Blue&filters[size]=Medium"
=> "filters[colour][]=Red&filters[colour][]=Blue&filters[size]=Medium"
irb(main):019:0> 
irb(main):020:0> Rack::Utils.parse_nested_query(query)
=> {"filters"=>{"colour"=>["Red", "Blue"], "size"=>"Medium"}}

解析url query 的参数为 hash:

Rack::Utils.parse_nested_query(query)

http://codefol.io/posts/How-Does-Rack-Parse-Query-Params-With-parse-nested-query/

返回列表