HTTPie --download: Save Response Bodies in CI
http --download url saves the response body to a file, choosing a name from the URL or Content-Disposition header.
HTTPie is request-first, but --download turns it into a downloader with a progress bar and resume support, useful for pulling a test fixture or build artifact.
What it does
--download (-d) writes the response body to disk instead of stdout, shows a progress bar on stderr, and derives the filename from the final URL or the Content-Disposition header. --output <file> overrides the name and --continue resumes a partial download (requires ranged support on the server).
Common usage
http --download example.com/artifacts/build.tar.gz
http --download --output=fixture.json example.com/api/export
# resume an interrupted download
http --download --continue --output=big.iso example.com/big.isoOptions
| Flag | What it does |
|---|---|
| --download, -d | Save the body to a file with a progress bar |
| --output, -o <file> | Explicit output filename |
| --continue, -c | Resume a partial download (needs --output) |
| --follow | Follow redirects to the final file |
In CI
Use --download --output=<name> so the filename is deterministic rather than guessed from headers. --continue requires the server to honor Range requests; against one that does not, it restarts from the beginning.
Common errors in CI
A downloaded file that is actually an HTML error page means the server returned a 2xx redirect page or the URL was wrong; add --check-status to fail on non-2xx. --continue without --output errors because HTTPie needs a known target file to resume into. A truncated file usually means the job hit the runner timeout mid-transfer.