Skip to content

Commit 202f59e

Browse files
committed
Tweak nested JSON docs
1 parent ba0c1ab commit 202f59e

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

docs/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,40 @@ Other JSON types, however, are not allowed with `--form` or `--multipart`.
681681
682682
If your use case involves sending complex JSON objects as part of the request body,
683683
HTTPie can help you build them right from your terminal. You still use the existing
684-
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.
684+
data field operators (`=`/`:=`) but instead of specifying a top-level field name (like `key=value`),
685+
you specify a path declaration. This tells HTTPie where and how to put the given value inside an object:
686+
687+
```bash
688+
http pie.dev/post \
689+
platform[name]=HTTPie \
690+
platform[about][mission]='Make APIs simple and intuitive' \
691+
platform[about][homepage]=httpie.io \
692+
platform[about][homepage]=httpie.io \
693+
platform[about][stars]:=54000 \
694+
platform[apps][]=Terminal \
695+
platform[apps][]=Desktop \
696+
platform[apps][]=Web \
697+
platform[apps][]=Mobile
698+
```
699+
700+
```json
701+
{
702+
"platform": {
703+
"name": "HTTPie",
704+
"about": {
705+
"mission": "Make APIs simple and intuitive",
706+
"homepage": "httpie.io",
707+
"stars": 54000
708+
},
709+
"apps": [
710+
"Terminal",
711+
"Desktop",
712+
"Web",
713+
"Mobile"
714+
]
715+
}
716+
}
717+
```
685718
686719
#### Introduction
687720

0 commit comments

Comments
 (0)