Tweak nested JSON docs

This commit is contained in:
Jakub Roztocil
2022-01-23 18:36:18 +01:00
parent ba0c1ab258
commit 202f59e04a

View File

@ -681,7 +681,40 @@ Other JSON types, however, are not allowed with `--form` or `--multipart`.
"about": { "about": {
"mission": "Make APIs simple and intuitive", "mission": "Make APIs simple and intuitive",
"homepage": "httpie.io", "homepage": "httpie.io",
} "stars": 54000
},
"apps": [
"Terminal",
"Desktop",
"Web",
"Mobile"
]
}
}
```
#### Introduction
Lets start with a simple example, and build a simple search query:
```bash
$ http --offline --print=B pie.dev/post \
category=tools \
search[type]=id \
search[id]:=1
```
In the example above, the `search[type]` is an instruction for creating an object called `search`, and setting the `type` field of it to the given value (`"id"`).
Also note that, just as the regular syntax, you can use the `:=` operator to directly pass raw JSON values (e.g, numbers in the case above).
```json
{
"category": "tools",
"search": {
"id": 1,
"type": "id"
}
} }
``` ```