mirror of
https://github.com/httpie/cli.git
synced 2025-07-16 05:55:00 +02:00
Tweak nested JSON docs
This commit is contained in:
@ -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
|
||||||
|
|
||||||
|
Let’s 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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user