What is the name of the serialization format for html forms used by ruby and php?

Viewed 56

When I have an html input field like this:

<input name="user[name]" value="peter">
<input name="user[emails][]" value="peter@example.com">
<input name="user[emails][]" value="peter_2@example.com">

It gets deserialized in a Ruby on Rails app to a hash like this:

{ "user" => { "name" => "peter", "emails" => ["peter@example.com", "peter_2@example.com"] } }

A PHP application (and possibly many more frameworks) will deserialize this in a similar way. I understand the process is also called demarshalling.

The browser will send this data in the application/x-www-form-urlencoded encoding, but that is not the level at which I want to understand this format, it seems more like a convention to indicate to the server how the data transmitted by the browser is to be parsed.

Here is my question:

What is the name of this serialization / marshalling format? Is it specified anywhere?

Edit:

I did a little digging. In rubyland this is handled by the parse_nested_query method of the Rack::QueryParser in the rack stack.

0 Answers
Related