Verdict: use it, and in scripts, distrust it a little. HTTPie turns curl -X POST -H 'Content-Type: application/json' -d '{"name":"x"}' into http POST api/items name=x, with colored output and sane defaults. It is the friendliest HTTP client I have used. The friendliness is a small language, though, and languages have keywords. I watched a user-supplied comment that began with @ make HTTPie read my .env and POST it. I watched a while read loop send the rest of its input file as the body of its first request. And I found my password saved in plain text by a flag with “read-only” in its name. All of it is documented and none of it is a vulnerability. Below is what I ran and the three habits that keep it that way. I have no relationship with HTTPie or its company. The CLI is BSD-3-Clause (checked against GitHub’s API), and nobody paid me.
Start with the threat model nobody writes: the HTTP client. It is the one program on your machine whose whole job is to take local things and hand them to a remote server. Now picture the escalation. Your support form forwards customer comments to an internal API through a shell script. A customer, possibly a three-letter agency wearing a fake moustache, types @/home/deploy/.env into the comment box. Your script obediently ships the deploy keys to the API, which stores them in the ticket, which is emailed to forty people and one shared inbox. Back to reality: this needs your script to put untrusted text straight into an HTTPie argument, which is exactly the kind of thing scripts do at 2 a.m.
SEVERITY: the customer who signs every message with an @. ATTACK VECTOR: a shell variable in double quotes.
Everything below ran for real with httpie 3.2.4 (pip install httpie in a venv, Python 3.14, Ubuntu) against a 20-line Python echo server on localhost:8000 that replies with the path, Authorization, Cookie and body it received. I ran it in a throwaway HOME (with XDG_CONFIG_HOME pointed inside it), so ~/.config/httpie below is a scratch folder and my real config stayed out of it. The passwords, tokens and keys are fake. The exit= lines come from an echo "exit=$?" I ran after the command, not from HTTPie.
What earns the install
key=value is a JSON string, key:=value is raw JSON, Header:value is a header, key==value is a query parameter, and :8000 means localhost:8000. You stop writing Content-Type by hand on day one. --offline builds the request and prints it without sending, which is the best feature in the box and does a lot of work later in this review.
It also gets redirects right in the way that matters to me. HTTPie doesn’t follow redirects unless you pass --follow, and when it does follow one to a different host it drops your credentials. My server on 127.0.0.1:8000 answered /bounce with a 302 to a second server on 127.0.0.2:8001, and both -a alice:hunter2 and a hand-written bearer header stayed home:
$ http -I -h :8000/bounce
HTTP/1.0 302 Found
Server: BaseHTTP/0.6 Python/3.14.4
Date: Mon, 30 Nov 2026 22:57:32 GMT
Location: http://127.0.0.2:8001/catch
$ http -I --follow -a alice:hunter2 127.0.0.1:8000/bounce
{"path": "/catch", "auth": null, "cookie": null, "body": ""}
$ http -I --follow 127.0.0.1:8000/bounce "Authorization:Bearer tok_live_abc123"
{"path": "/catch", "auth": null, "cookie": null, "body": ""}
"auth": null at the far end is the right answer. One more scripting note: a 302 exits 0 by default. Add --check-status and the same request exits 3 with http: warning: HTTP 302 Found, so your script can tell.
The part where a comment reads your .env
key=@path is documented syntax for “use the contents of this file as the value.” It is very handy when you type it on purpose. It is less handy when the @ arrives inside a variable:
$ echo 'AWS_SECRET=not-a-real-key' > /tmp/lab/.env
$ comment='@/tmp/lab/.env'
$ http -I POST :8000/c "comment=$comment"
{"path": "/c", "auth": null, "cookie": null, "body": "{\"comment\": \"AWS_SECRET=not-a-real-key\\n\"}"}
The shell expanded comment=$comment into comment=@/tmp/lab/.env, which is the file-embed separator, so HTTPie read the file and sent its contents. That is HTTPie doing exactly what its grammar says. The grammar just has no idea which half of the argument came from a stranger. Every convenience is an attack surface with better marketing, and this one’s marketing is “no more quoting JSON by hand.”
The part where a loop mails its homework to the first request
When stdin isn’t a terminal, HTTPie assumes stdin is the request body. That’s lovely for cat body.json | http POST …. Inside a while read loop, stdin is the loop’s input file:
$ printf 'alpha\nbravo\ncharlie\n' > ids.txt
$ while read -r id; do http :8000/item/$id; echo; done < ids.txt
{"path": "/item/alpha", "auth": null, "cookie": null, "body": "bravo\ncharlie\n"}
One request instead of three. The first call ate the rest of the file, sent it as the body, and quietly switched the method too. --offline shows that piped data turns a plain http :8000/item/alpha into POST /item/alpha HTTP/1.1. The remaining IDs went to the server as data instead of being looked up, and the loop ended without an error. If that file held anything private, the first endpoint has it now.
The opposite failure is a hang. My first test command, run from an agent harness whose stdin was an open pipe that never closed, sat there until the harness killed it at two minutes. Reproduced on purpose:
$ sleep 30 | timeout 15 http :8000/
> warning: no stdin data read in 10.0s (perhaps you want to --ignore-stdin)
> See: https://httpie.io/docs/cli/best-practices
exit=124
To be fair, HTTPie prints a warning that names the fix, and the docs’ “Best practices” section says to use --ignore-stdin in scripts. You find out only when a cron job hangs.
The part where “read-only” wrote my password down
--session=work saves auth, cookies and custom headers per host, so the next call is logged in. The docs say it plainly: “All session data, including credentials, prompted passwords, cookie data, and custom headers are stored in plain text.” They mean it:
$ http -I --session=work -a alice:hunter2 :8000/login
{"path": "/login", "auth": "Basic YWxpY2U6aHVudGVyMg==", "cookie": null, "body": ""}
$ grep -A1 raw_auth ~/.config/httpie/sessions/localhost_8000/work.json
"raw_auth": "alice:hunter2",
"type": "basic"
A bearer token passed as a header lands in the same file under headers, and so does the sid cookie the server set. The honest walk-back: the per-host folder was created drwx------, so another user on the box can’t read the 0644 files inside it. If you give --session a path instead of a name, the file is created -rw-r--r-- wherever you pointed it, with no protective folder. Your home directory also gets backed up, synced and copied to new laptops. The plain-text file goes everywhere your home directory goes.
Then I reached for --session-read-only, assuming it would never write. On a session that didn’t exist yet, it wrote one:
$ http -I --session-read-only=ro -a bob:pw2 :8000/login >/dev/null
$ grep raw_auth ~/.config/httpie/sessions/localhost_8000/ro.json
"raw_auth": "bob:pw2",
That is by design. httpie/client.py saves when httpie_session.is_new() or not args.session_read_only, and the docs describe the flag as not updating the session “after it has been created.” Read-only means “write once, then freeze,” not “never write.”
The three mitigations that matter
I ran each of these in the same sandbox, ranked by how much risk they remove.
1. Never splice untrusted text into key=value. Build the body with jq and preview it with --offline. jq --arg treats the value as a plain string, so an @ is just a character:
$ jq -n --arg c '@/tmp/lab/.env' '{comment:$c}' | http --offline POST :8000/c | tail -2
"comment": "@/tmp/lab/.env"
}
The literal string went out and the file stayed home. If you must use the key=value syntax, a backslash escapes the separator ("comment=\\$comment" in my script sent {"comment": "@/tmp/lab/.env"}), but you have to remember it on every field, every time. The jq pipe is the habit that holds up when you forget. Either way, --offline shows you the exact request before anything goes out.
2. Put -I (--ignore-stdin) on every scripted call that doesn’t pipe a body. The same loop with the flag made three clean requests:
$ while read -r id; do http --ignore-stdin :8000/item/$id; echo; done < ids.txt
{"path": "/item/alpha", "auth": null, "cookie": null, "body": ""}
{"path": "/item/bravo", "auth": null, "cookie": null, "body": ""}
{"path": "/item/charlie", "auth": null, "cookie": null, "body": ""}
Put it on the command, not in config. I tried {"default_options": ["--ignore-stdin"]} in config.json, and it fixed the loop, but it also broke deliberate piping. --no-ignore-stdin is documented as the way to undo a default, and in 3.2.4 it didn’t work for this flag. With the config set, echo '{"x":1}' | http --no-ignore-stdin --offline POST :8000/item sent Content-Length: 0. Without the config, the same command sent the 8-byte body. The cause is in httpie/cli/argparser.py: has_stdin_data is computed before _apply_no_options runs, so the undo arrives too late. An explicit -I in your scripts avoids the whole question.
3. Keep credentials out of saved sessions. --session-read-only won’t stop the first write, so for scripts I skip sessions and pass the secret fresh each call (-A bearer -a "$TOKEN" from the environment). When I do want a session for one job, I give that job its own throwaway config directory:
$ d=$(mktemp -d)
$ HTTPIE_CONFIG_DIR=$d http -I --session=t -a alice:hunter2 :8000/ >/dev/null
$ ls -ld $d
drwx------ 3 runner runner 4096 Nov 30 22:59 /tmp/tmp.g5BKqJc94H
$ rm -rf "$d"
$ ls -d $d
ls: cannot access '/tmp/tmp.g5BKqJc94H': No such file or directory
The directory is private while the job runs and gone when it ends. For interactive use, named sessions under your 0700 config folder are a reasonable trade, as long as you remember they’re stored in plain text and treat ~/.config/httpie/sessions/ like ~/.ssh/.
While we’re here: http means http
The http command defaults to the http:// scheme. http example.com goes out unencrypted, and so would anything you attached to it. HTTPie ships a twin command, https, that defaults to TLS. Pointed at my plain-HTTP echo server, it refused to send in the clear:
$ https -I :8000/
https: error: SSLError: HTTPSConnectionPool(host='localhost', port=8000): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: RECORD_LAYER_FAILURE] record layer failure (_ssl.c:1081)'))) while doing a GET request to URL: https://localhost:8000/
exit=1
That’s the failure you want. Type https by habit for anything that isn’t localhost, or write the scheme out in full.
Bottom line
HTTPie is a delight at the keyboard. Its readable request syntax, colored output and --offline preview are the reasons to install it, and it handles cross-host redirects more carefully than a lot of hand-rolled scripts do. Its risks come from that same convenience. Everything after the URL is parsed as a small language, and @ in a value means “read this file.” Piped stdin becomes the body, and a saved session stores the password. All of it is documented, mostly in the docs’ “Best practices” and “Sessions” sections. Script it with -I, build untrusted bodies with jq, and keep secrets out of session files. One note for the risk register: the GitHub repo’s last push was December 2024, and 3.2.4 was the current PyPI release when I installed it. Source and docs: github.com/httpie/cli.