Updated 10 hours ago
HTTPie (pronounced "aitch-tee-tee-pie") is a command-line HTTP client that does what curl does, but designed for humans instead of scripts.
The difference isn't features. It's philosophy. curl makes you speak its language. HTTPie speaks yours.
The Difference in Practice
Sending a POST request with JSON data and an auth header:
curl:
HTTPie:
HTTPie figures out that you want JSON (because who doesn't?), that you want HTTPS (because it's not 2005), and that name=John means {"name": "John"} (because of course it does).
Installation
The Syntax
The pattern: http [METHOD] URL [ITEMS]
The Operators
HTTPie uses different operators for different things. This looks arbitrary until you see the logic:
| Operator | Meaning | Example |
|---|---|---|
= | String value | name=John → "name": "John" |
:= | Raw JSON | age:=30 → "age": 30 |
== | Query parameter | q==test → ?q=test |
: | Header | Authorization:"Bearer x" |
The colon in := means "this is literal"—a number, boolean, array, or object. Without it, everything becomes a string.
Generates:
Headers
The colon separator distinguishes headers from data:
No -H flag. HTTPie sees the colon and knows.
Query Parameters
Double-equals puts it in the URL:
Authentication
Form Data and File Uploads
Controlling Output
HTTPie colorizes and formats JSON automatically. Control what you see with -p:
H= request headersB= request bodyh= response headersb= response body
Sessions
Persist cookies and auth across requests:
Sessions live in ~/.httpie/sessions/.
Downloading Files
Other Options
In Scripts
HTTPie is designed for humans, but it works in scripts:
HTTPie vs. curl
Use HTTPie when:
- Testing APIs interactively
- Exploring a new API
- You want readable, colorized output
- You're tired of escaping JSON in quotes
Use curl when:
- Writing scripts (curl's output is more predictable)
- You can't install additional tools
- You need non-HTTP protocols
- It's already in the system
They solve the same problem for different audiences. curl optimizes for machines and scripts. HTTPie optimizes for the human at the keyboard.
Frequently Asked Questions About HTTPie
Was this page helpful?