1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

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`.
If your use case involves sending complex JSON objects as part of the request body,
HTTPie can help you build them right from your terminal. You still use the existing
data field operators (`=`/`:=`) but instead of specifying a top-level field name (like `key=value`), you specify a path declaration. This tells HTTPie where and how to put the given value inside an object.
data field operators (`=`/`:=`) but instead of specifying a top-level field name (like `key=value`),
you specify a path declaration. This tells HTTPie where and how to put the given value inside an object:
```bash
http pie.dev/post \
platform[name]=HTTPie \
platform[about][mission]='Make APIs simple and intuitive' \
platform[about][homepage]=httpie.io \
platform[about][homepage]=httpie.io \
platform[about][stars]:=54000 \
platform[apps][]=Terminal \
platform[apps][]=Desktop \
platform[apps][]=Web \
platform[apps][]=Mobile
```
```json
{
"platform": {
"name": "HTTPie",
"about": {
"mission": "Make APIs simple and intuitive",
"homepage": "httpie.io",
"stars": 54000
},
"apps": [
"Terminal",
"Desktop",
"Web",
"Mobile"
]
}
}
```
#### Introduction