Skip to main content

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.

✓ Color-coded JSON output ✓ Intuitive syntax ✓ JSON by default ✓ Sessions support ✓ Desktop GUI available ✓ Free & open source

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

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 formattingAutomatic, color-codedRaw output (pipe to jq)
Syntax for POST JSONhttp POST url key=valcurl -X POST -H ... -d '...'
Default availabilityRequires installPre-installed on most systems
Protocol supportHTTP/HTTPSHTTP, FTP, SFTP, SCP, and more
SessionsBuilt-in (--session)Manual cookie jar (-b/-c)
Learning curveLow - intuitive syntaxMedium - 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.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →