1
0
mirror of https://github.com/httpie/cli.git synced 2025-07-15 01:34:27 +02:00

Add --compress documentation (#1173)

* Add --compress documentation

* Apply suggestions from code review

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>

* Update docs/README.md

* Update docs/README.md

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
Mickaël Schoentgen
2021-10-08 18:38:40 +02:00
committed by GitHub
parent 6befaf9067
commit ab8512f96c

View File

@ -1304,7 +1304,8 @@ The universal method for passing request data is through redirected `stdin`
$ echo -n '{"name": "John"}' | http PATCH pie.dev/patch X-API-Token:123
```
You can also use a Bash *here string*:
```bash
$ http pie.dev/post <<<'{"name": "John"}'
```
@ -1414,6 +1415,24 @@ $ http --chunked pie.dev/post @files/data.xml
HTTPie does several things by default in order to make its terminal output easy to read.
### Colors and formatting
<!-- TODO: mention body colors/formatting are based on content-type + --response-mime (heuristics for JSON content-type) -->
Syntax highlighting is applied to HTTP headers and bodies (where it makes sense).
You can choose your preferred color scheme via the `--style` option if you don’t like the default one.
There are dozens of styles available, here are just a few notable ones:
| Style | Description |
| --------: | ----------------------------------------------------------------------------------------------------------------------------------- |
| `auto` | Follows your terminal ANSI color styles. This is the default style used by HTTPie |
| `default` | Default styles of the underlying Pygments library. Not actually used by default by HTTPie. You can enable it with `--style=default` |
| `monokai` | A popular color scheme. Enable with `--style=monokai` |
| `fruity` | A bold, colorful scheme. Enable with `--style=fruity` |
| … | See `$ http --help` for all the possible `--style` values |
Use one of these options to control output processing:
| Option | Description |
| ----------------: | ------------------------------------------------------------- |
| `--pretty=all` | Apply both colors and formatting. Default for terminal output |
| `--pretty=colors` | Apply colors |