carapace-sh/carapace-bin / skills/httpie
httpie
UnverifiedUse when working with HTTPie (http/https CLI) — the command-line HTTP client for the API era. Covers request items syntax (headers, params, data fields, file uploads), authentication (basic, digest, bearer, plugins), session management, output formatting and printing, SSL/TLS configuration, download mode, configuration files, environment variables, plugin system, exit codes, scripting, and URL syntax. Triggers on: "httpie", "http command", "https command", "http --json", "http --form", "http --download", "http --session", "http --auth", "http --auth-type", "http --print", "http --verbose", "http --follow", "http --offline", "http --check-status", "http --proxy", "http --ssl", "http --cert", "http --verify", "http --format-options", "http --pretty", "http --style", "http --stream", "http --boundary", "http --multipart", "http --raw", "httpie config", "HTTPIE_CONFIG_DIR", "httpie cli plugins", "request items", "data fields", "URL parameters", "HTTP headers", "raw JSON fields", "file upload fields", "named session", "anonymous session", "read-only session", "Content-Disposition", "httpie-unixsocket", "httpie plugins", "AuthPlugin", "TransportPlugin", "ConverterPlugin", "FormatterPlugin".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.2 KB |
| references/auth.md | markdown | 3.3 KB |
| references/cli.md | markdown | 6.6 KB |
| references/config.md | markdown | 4.0 KB |
| references/downloads.md | markdown | 3.7 KB |
| references/output.md | markdown | 6.1 KB |
| references/plugins.md | markdown | 5.6 KB |
| references/request-items.md | markdown | 4.9 KB |
| references/scripting.md | markdown | 3.7 KB |
| references/sessions.md | markdown | 5.0 KB |
| references/ssl.md | markdown | 2.8 KB |
| references/url-syntax.md | markdown | 3.5 KB |
references/downloads.md
View on GitHub# Download Mode
HTTPie's wget-like download mode — saving response bodies to files, resuming interrupted downloads, and piping while downloading.
## Overview
The `--download` (`-d`) flag makes HTTPie act like `wget`: response headers are printed to stderr, a progress bar is shown, and the response body is saved to a file.
```bash
$ http --download https://github.com/httpie/cli/archive/master.tar.gz
```
Output:
```
HTTP/1.1 200 OK
Content-Disposition: attachment; filename=httpie-master.tar.gz
Content-Length: 257336
Content-Type: application/x-gzip
Downloading 251.30 kB to "httpie-master.tar.gz"
Done. 251.30 kB in 2.73862s (91.76 kB/s)
```
## Implied Behaviors
`--download` implies several other behaviors:
| Behavior | Reason |
|----------|--------|
| `--follow` | Redirects are always followed during downloads |
| `--check-status` | Error HTTP status codes result in non-zero exit |
| Exit code `1` | If the body is not fully downloaded |
`Accept-Encoding` **cannot** be set with `--download`.
## Filename Determination
The output filename is determined by three methods in priority order:
| Priority | Source | Example |
|----------|--------|---------|
| 1 (highest) | `--output, -o` flag | `--output=file.zip` |
| 2 | `Content-Disposition` header | `attachment; filename=report.pdf` |
| 3 (lowest) | URL + Content-Type fallback | Derived from URL path and response MIME type |
The initial URL is always used as the basis for the fallback filename, even after redirects.
Leading dots are stripped from server-provided filenames. To prevent data loss, HTTPie adds a unique numerical suffix when a file already exists (unless `--output` is explicitly specified).
## Resuming Downloads (`--continue`, `-c`)
Resume an interrupted download with `--continue` (`-c`). Requires `--output` (`-o`) and server `Range` request support:
```bash
$ http -dco file.zip example.org/file
```
`-dco` is shorthand for `--download --continue --output`.
If the server doesn't support `Range` requests and `206 Partial Content`, the entire file is re-downloaded.
## Piping While Downloading
Redirect the response body to another program while still showing headers and progress:
```bash
$ http -d https://github.com/httpie/cli/archive/master.tar.gz | tar zxf -
```
## Redirected Output (Without `--download`)
When output is redirected (piped to another command or saved to a file), HTTPie uses different defaults:
- No formatting or colors (unless `--pretty` is specified)
- Only the response body is printed (unless output options are set)
- Binary data is not suppressed
```bash
# Download a file via shell redirection
$ http pie.dev/image/png > image.png
# Pipe to ImageMagick, then re-upload
$ http octodex.github.com/images/original.jpg | convert - -resize 25% - | http example.org/Octocats
# Force formatting when piping
$ http --pretty=all --verbose pie.dev/get | less -R
```
Helper function for paged output:
```bash
function httpless {
http --pretty=all --print=hb "$@" | less -R
}
```
## Conditional Body Download
The response body is only downloaded from the server if it's part of the output. Headers are always downloaded. This optimization saves bandwidth when you only need headers (e.g., `--headers`). This doesn't affect `--output` or `--download`.
## Carapace Completion
The carapace completer completes `--output` with `carapace.ActionFiles()`. The `--download` and `--continue` flags are boolean and do not require value completion.
## References
- Source of truth: <https://httpie.io/docs/cli/downloads>
- Carapace completer: `completers/common/http_completer/cmd/root.go`
## Related Skills
- [output.md](output.md) — output formatting and `--output`
- [scripting.md](scripting.md) — exit codes and `--check-status`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |