RestKit/RestKit — comment on commit d6e26a6f9dc0242e670833ee27b010f8bd554f9f
File: Specs/Support/NSDictionary+RKRequestSerializationSpec.m line 73
By bradphelan:

It's a very good question but this is how rails does it. Not sure the algorithm that is used but this blog post clarifies what works

http://www.spacevatican.org/2008/7/18/parametrised-to-the-max

Specifically

So how does rails know when one record is finished and the next start? Simple: if we’ve already had a users[][name] parameter and we see a new one then we can usually assume that the next one must belong to a new user

parse "users[][name]=fred&users[][email]=fred@example.com&
users[][name]=bob&users[][email]=bob@example.com"
=> {"users"=>[{"name"=>"fred", "email"=>"fred@example.com"},
{"name"=>"bob", "email"=>"bob@example.com"}]}
To continue with a previous example, a user might have several addresses:

parse "user[name]=fred&user[addresses][][line]=24+bob+street&user[addresses][][town]=cambridge&
user[addresses][][line]=1+market+square&user[addresses][][town]=bedford"
=> {"user"=>{"name"=>"fred", "addresses"=>[
{"line"=>"24 bob street", "town"=>"cambridge"},
{"line"=>"1 market square", "town"=>"bedford"}]
}}