You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-11-29 22:58:15 +02:00
Support multiple headers sharing the same name (#1190)
* Support multiple headers sharing the same name * Apply suggestions * Don't normalize HTTP header names * apply visual suggestions Co-authored-by: Jakub Roztocil <jakub@roztocil.co> * bump down multidict to 4.7.0 Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
@@ -869,6 +869,39 @@ To send a header with an empty value, use `Header;`, with a semicolon:
|
||||
|
||||
```bash
|
||||
http --offline example.org Numbers:one,two
|
||||
```
|
||||
|
||||
```http
|
||||
GET / HTTP/1.1
|
||||
Numbers: one,two
|
||||
```
|
||||
|
||||
Also be aware that if the current session contains any headers they will get overwriten
|
||||
by individual commands when sending a request instead of being joined together.
|
||||
|
||||
### Limiting response headers
|
||||
|
||||
The `--max-headers=n` options allows you to control the number of headers HTTPie reads before giving up (the default `0`, i.e., there’s no limit).
|
||||
|
||||
```bash
|
||||
$ http --max-headers=100 pie.dev/get
|
||||
```
|
||||
|
||||
## Offline mode
|
||||
|
||||
Use `--offline` to construct HTTP requests without sending them anywhere.
|
||||
With `--offline`, HTTPie builds a request based on the specified options and arguments, prints it to `stdout`, and then exits. It works completely offline; no network connection is ever made. This has a number of use cases, including:
|
||||
|
||||
Generating API documentation examples that you can copy & paste without sending a request:
|
||||
|
||||
```bash
|
||||
$ http --offline POST server.chess/api/games API-Key:ZZZ w=magnus b=hikaru t=180 i=2
|
||||
```
|
||||
|
||||
```bash
|
||||
$ http --offline MOVE server.chess/api/games/123 API-Key:ZZZ p=b a=R1a3 t=77
|
||||
```
|
||||
|
||||
Generating raw requests that can be sent with any other client:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user