HTTPie
Human-friendly HTTP client for the terminal. Color-coded JSON output, intuitive key=value syntax, JSON by default - no flags required for common operations. The developer-friendly alternative to curl.
What is HTTPie?
HTTPie is a command-line HTTP client built around one principle: interacting with HTTP APIs should be as readable and intuitive as possible for humans. Where curl requires flags like -X POST, -H "Content-Type: application/json", and -d '{...}', HTTPie infers them from simple key=value arguments and handles JSON formatting automatically.
HTTPie automatically color-codes and pretty-prints JSON responses, sets appropriate headers based on the data you provide, supports persistent sessions for cookie and auth management, and includes a plugin ecosystem for OAuth, JWT, and other extensions. A free desktop GUI (HTTPie Desktop) is also available for macOS, Windows, and Linux.
Key Features
- Human-readable output - JSON responses are automatically formatted and color-coded in the terminal
- Intuitive syntax - key=value for strings, key:=value for JSON types; no -X, no --data needed
- JSON by default - sets Content-Type and Accept headers automatically when sending data
- Sessions - persist cookies, auth, and custom headers across multiple requests with --session
- File uploads - multipart form upload with key@/path/to/file syntax
- Downloads - save responses to disk with --download
- Plugin ecosystem - extend with OAuth, JWT, HMAC auth, and more via pip-installable plugins
- HTTPie Desktop - free GUI app with collections, history, and visual request builder
Installation
# macOS (Homebrew) brew install httpie # Python / pip (cross-platform) pip install httpie # Ubuntu / Debian sudo apt install httpie # Windows (Scoop) scoop install httpie # Verify installation http --version # HTTPie Desktop GUI (macOS / Windows / Linux) # https://httpie.io/desktop
GET Requests
GET is the default method when no body data is provided. Query parameters use the key==value syntax (double equals). HTTPie always pretty-prints and color-codes JSON responses.
# Simple GET request - HTTPie adds headers and pretty-prints JSON automatically http GET https://api.github.com/users/torvalds # Shorthand - GET is the default when no body is provided http https://api.github.com/users/torvalds # With query parameters (key==value syntax) http https://api.github.com/search/repositories q==httpie sort==stars # Response headers only http --headers https://api.github.com/users/torvalds # Response body only (pipe-friendly) http --body https://api.github.com/users/torvalds
POST with JSON Body
Use key=value for strings and key:=value for non-string JSON types (numbers, booleans, arrays). HTTPie sets Content-Type: application/json automatically.
# POST with JSON body - HTTPie sends JSON by default when key=value pairs are given
http POST https://httpbin.org/post name="Alice" age:=30 active:=true
# Equivalent curl command for comparison:
# curl -X POST https://httpbin.org/post # -H "Content-Type: application/json" # -d '{"name":"Alice","age":30,"active":true}'
# POST with explicit raw JSON
echo '{"name":"Alice"}' | http POST https://httpbin.org/post Content-Type:application/json
# POST with a JSON file
http POST https://httpbin.org/post @payload.json
# Form data (not JSON)
http --form POST https://httpbin.org/post username=alice password=secret Authentication & Sessions
Headers use the Name:value syntax (single colon). Sessions persist cookies and auth across requests - log in once, then reuse the session for subsequent calls.
# Bearer token auth http GET https://api.example.com/profile Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9..." # HTTP Basic auth http -a username:password GET https://api.example.com/protected # API key in header http GET https://api.example.com/data X-API-Key:your-key-here # Session - persist cookies and headers across requests http --session=./session.json POST https://api.example.com/login [email protected] password=secret http --session=./session.json GET https://api.example.com/me
File Upload & Advanced Options
HTTPie handles multipart uploads, file downloads, redirects, timeouts, and verbose output for debugging - all with readable flags.
# Upload a file (multipart form) http --form POST https://httpbin.org/post file@/path/to/photo.jpg # Download a file and save it http --download https://example.com/file.zip # Follow redirects http --follow GET https://httpbin.org/redirect/3 # Set timeout (seconds) http --timeout=10 GET https://slow-api.example.com/data # Verbose mode - shows request and response headers http --verbose POST https://httpbin.org/post name=test
HTTPie vs curl
| Feature | HTTPie | curl |
|---|---|---|
| JSON formatting | Automatic, color-coded | Raw output (pipe to jq) |
| Syntax for POST JSON | http POST url key=val | curl -X POST -H ... -d '...' |
| Default availability | Requires install | Pre-installed on most systems |
| Protocol support | HTTP/HTTPS | HTTP, FTP, SFTP, SCP, and more |
| Sessions | Built-in (--session) | Manual cookie jar (-b/-c) |
| Learning curve | Low - intuitive syntax | Medium - many flags to memorize |
Pros and Cons
Pros
- ✓ Automatic JSON pretty-printing and color highlighting
- ✓ Extremely intuitive syntax - far less typing than curl
- ✓ Sends JSON by default for common POST/PUT/PATCH operations
- ✓ Built-in session management for cookie persistence
- ✓ Free desktop GUI available for non-CLI workflows
- ✓ Plugin ecosystem for custom auth schemes
Cons
- ✗ Not pre-installed on most systems (requires pip/brew)
- ✗ Python dependency can complicate some environments
- ✗ Only supports HTTP/HTTPS (no FTP, SFTP, etc.)
- ✗ Slower startup than curl for high-frequency scripting
- ✗ Less commonly found in CI base images than curl
Frequently Asked Questions
What is HTTPie?▼
HTTPie is a command-line HTTP client designed to make interacting with APIs and web services as human-friendly as possible. Unlike curl, HTTPie automatically formats and color-codes JSON responses, uses an intuitive key=value syntax for request data, sends JSON by default for POST/PUT/PATCH requests, and displays request and response headers in a readable way. It is available as a CLI tool, a Python library, and a desktop GUI application.
How does HTTPie compare to curl?▼
curl is a lower-level, highly portable HTTP client focused on flexibility and scripting. HTTPie is a higher-level tool optimized for human readability and ease of use. With HTTPie you write 'http POST api.example.com/users name=Alice' instead of curl's verbose flags and raw JSON strings. HTTPie color-codes output, auto-formats JSON, and infers Content-Type from the data you provide. curl has broader protocol support (FTP, SFTP, etc.) and is available on virtually every system by default.
How do I send JSON data with HTTPie?▼
HTTPie sends JSON automatically when you use the key=value syntax for request data. String values use = (e.g., name=Alice), non-string values (numbers, booleans, arrays, objects) use := (e.g., age:=30, active:=true, tags:=["a","b"]). HTTPie sets Content-Type: application/json and Accept: application/json headers automatically. To send a raw JSON string, pipe it via stdin. To send a JSON file: http POST url @data.json.
How do HTTPie sessions work?▼
Sessions let you persist cookies, auth headers, and custom headers across multiple requests without repeating them. Create or reuse a session with --session=./session.json (a file path) or --session=session-name (a named session stored in your config dir). The first request with --session stores any Set-Cookie headers and auth info. Subsequent requests using the same session file automatically include those cookies and headers. This is useful for testing authenticated API flows where you log in once and then make several requests.
Is HTTPie free?▼
Yes. The HTTPie CLI is fully free and open source under the BSD license. It is available on PyPI (pip install httpie), Homebrew, APT, and other package managers. The HTTPie Desktop GUI application is also free to download and use. There is no paid tier, no account required for the CLI, and no feature gating - the full tool is available to everyone.
What is HTTPie Desktop?▼
HTTPie Desktop is a free GUI application that brings HTTPie's human-friendly interface to a visual, point-and-click environment. It supports the same intuitive syntax as the CLI, adds request collections, environment variables, response history, and a visual request builder. It is available for macOS, Windows, and Linux and is built on the same open-source foundation as the CLI. HTTPie Desktop is a direct alternative to Postman or Insomnia for developers who prefer a GUI over the terminal.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
API Request Builder
Build and test HTTP requests visually with any method, headers, and body. Generate cURL commands instantly. Free online API testing tool with Pro unlimited access. No signup required.
Open free tool →
API Response Mock Generator
Generate realistic mock API responses with custom status codes, headers, and JSON body. Quick templates for 200, 401, 404, 429, 500 and more. Runs in your browser.
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
GraphQL Federation vs REST Microservices: Which Architecture in 2026?
Compare GraphQL Federation vs REST microservices — Apollo Federation, schema stitching, performance, team scaling, migration paths, and when to choose each in 2026.
tRPC vs GraphQL vs REST: Type-Safe APIs in 2026
Compare tRPC, GraphQL, and REST for building type-safe APIs in 2026. Covers DX, performance, bundle size, schema management, and when to use each approach.
7 Free Postman Alternatives That Won't Lock Your Collections in the Cloud
Discover 7 free Postman alternatives including Bruno, Insomnia, and Hoppscotch. Keep your API collections local and under version control.
Complete HTTP Status Codes Reference for REST API Devs
The complete HTTP status codes reference for REST API developers. Every 1xx, 2xx, 3xx, 4xx, and 5xx code explained with real-world API examples and best practices.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →