Skip to content
This repository was archived by the owner on Jul 14, 2022. It is now read-only.

Commit 2fcfc51

Browse files
committed
updated readme to mention passing a request body via stdin
1 parent 2843738 commit 2fcfc51

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,22 @@ _(optional)_
122122
|`html`|`text/html`|
123123
|`xml`|`application/xml`|
124124
|`plain`|`text/plain`|
125+
126+
### Providing a Request Body via stdin
127+
128+
In addition to `-b`/`--body`, you may provide a request body via stdin.
129+
If you combine this method with the `-b` flag, the body provided with `-b` will be ignored.
130+
131+
**Example with Pipes**
132+
```shell
133+
$ echo '{"foo":"bar"}' | hopp-cli post -c js http://example.com
134+
```
135+
**Example with Redirection**
136+
```shell
137+
$ cat myrequest.json
138+
{
139+
"foo": "bar"
140+
}
141+
142+
$ hopp-cli post -c js http://example.com <myrequest.json
143+
```

0 commit comments

Comments
 (0)