Question: Since `name='country[city]` works to create `{city:"Some City"}` I was thinking `name='country[city[street]]'` would create `{city:{street:"Some Street"}}`

But to my disappointment it didn't! Is there another way to achieve this in a not too complicated way?

Answer: 
> 
> Since `name='country[city]` works to create `{city:"Some City"}` 
> 
> 
> 

It doesn't, at least not in any standard way.

Any standard form encoding will just set the name to `"country[city]"`. You can see that by using a GET form and looking at the resulting URL. It is non-standard extensions to `application/x-www-form-urlencoded` which start expanding it into data types that are more complicated than a string once the data is parsed on the server.

In general, those systems let you nest as deep as you like. You just need to put the square brackets in the right place:

```
name="country[city][street]"

```
This would produce your expectation:

```
<form action="#">
    <input type="text" name="city[street]">
    <input type="submit" value="Go">
</form>

```

Result:

```
{"city":{"street":"Some Street"}}

```

More levels:

```
<form action="#">
    <input type="text" name="country[city][street]">
    <input type="submit" value="Go">
</form>

```

Result:

```
{"country":{"city":{"street":"Some Street"}}}

```