Rails 和其他框架使用一个 Ruby 中间件将您发送到服务器的参数解析为嵌套Hash
对象。
如果将这些参数发送到服务器:
person[id] = 1
person[name] = Joe Blow
person[email] = joe.blow@test.com
person[address][street_address] = 123 Somewhere St.
person[address][city] = Chicago
person[address][zip] = 12345
person[other_field][] = 1
person[other_field][] = 2
person[other_field][] = 3
他们被解析为:
{
:person => {
:id => "1",
:name => "Joe Blow",
:email => "joe.blow@test.com",
:address => {
:street_address => "123 Somewhere St.",
:city => "Chicago",
:state => "IL",
:zip => "12345"
},
:other_field => [ 1, 2, 3 ]
}
}
我相信 PHP 也支持这一点。谁能告诉我这个约定叫什么,它来自哪里,还有哪些其他语言支持它?(Perl、Python 等)