HTTPie is an intuitive, user-friendly command-line HTTP client with JSON support, syntax highlighting, and persistent sessions.
Basic Commands
http GET api.example.com/users
http POST api.example.com/users name="John Doe" email="[email protected]"
http PUT api.example.com/users/1 status="active"
http DELETE api.example.com/users/1
Request Items Syntax
| Syntax | Description | Example |
|---|---|---|
field=value |
String field in JSON or form | name="Alice" |
field:=raw_json |
Non-string JSON typed value (number, bool) | age:=30 active:=true |
Header:Value |
Custom HTTP request header | Authorization:"Bearer token" |
[email protected] |
Embed file contents as field value | [email protected] |
field@filename |
Form file upload (-f) |
[email protected] |
param==value |
URL query parameter | limit==10 page==2 |
Authentication
http -a username:password api.example.com/protected # Basic auth
http -A bearer -a secret_token api.example.com/data # Bearer token auth
Output Formatting & Downloads
http -v api.example.com/users # Print entire HTTP exchange (headers & body)
http -h api.example.com/users # Print response headers only
http -b api.example.com/users # Print response body only
http -d api.example.com/archive.zip # Download file with progress bar (like wget)
http -o myfile.tar.gz api.example.com/file # Output to custom filename