CLI ToolsApr 11, 2026·2 min read

HTTPie CLI — Modern User-Friendly Command-Line HTTP Client

HTTPie is a modern, user-friendly command-line HTTP client for the API era. Intuitive syntax, formatted and colorized output, JSON support, sessions, authentication, file uploads, and plugins. The friendly alternative to curl for API exploration.

TL;DR
HTTPie replaces curl with intuitive syntax, colorized output, built-in JSON support, and session management for API work.
§01

What it is

HTTPie is a command-line HTTP client designed for API exploration and testing. It provides an intuitive syntax where headers, query parameters, and JSON data are expressed naturally. Output is automatically formatted and colorized, making API responses readable without piping through jq.

HTTPie targets developers, QA engineers, and anyone who works with HTTP APIs from the terminal. If you find curl's flag syntax hard to remember, HTTPie offers a more ergonomic alternative with sensible defaults.

§02

How it saves time or tokens

This workflow provides installation commands and common usage patterns. Instead of looking up curl flags for POST requests with JSON bodies, you get a natural syntax where http POST url key=value does the right thing. Sessions persist cookies and headers across requests, eliminating repetitive authentication headers.

§03

How to use

  1. Install HTTPie:
# macOS
brew install httpie

# Debian/Ubuntu
sudo apt install httpie

# Python
pip install httpie
  1. Make requests with intuitive syntax:
# GET request
http httpbin.org/get

# POST JSON data
http POST httpbin.org/post name=John age:=30 admin:=true

# Custom headers
http httpbin.org/headers Authorization:'Bearer token123'

# Download a file
http --download https://example.com/file.zip
  1. Use sessions for persistent state:
# Create a named session
http --session=myapi POST api.example.com/login username=admin password=secret

# Subsequent requests reuse cookies and headers
http --session=myapi api.example.com/dashboard
§04

Example

# API testing workflow
# 1. Authenticate and save session
http --session=dev POST https://api.example.com/auth/login \
  email=dev@example.com password=secret

# 2. Create a resource (session carries auth cookie)
http --session=dev POST https://api.example.com/items \
  name='New Item' category='tools' price:=29.99

# 3. List resources with query params
http --session=dev https://api.example.com/items \
  page==1 per_page==20 sort==created_at

# 4. Upload a file
http --session=dev POST https://api.example.com/upload \
  file@./document.pdf
§05

Related on TokRepo

§06

Common pitfalls

  • HTTPie uses = for string values and := for raw JSON (numbers, booleans, arrays). Using = for a number sends it as a string, which may cause API validation errors.
  • The == operator is for query parameters, not equality. http url page==2 adds ?page=2 to the URL.
  • HTTPie defaults to JSON content type for POST requests. To send form data instead, use the --form flag.

Frequently Asked Questions

How does HTTPie compare to curl?+

HTTPie provides a more intuitive syntax, automatic JSON formatting, colorized output, and built-in session management. curl is more versatile for low-level HTTP operations and scripting. HTTPie focuses on developer ergonomics for API testing.

Does HTTPie support authentication?+

Yes. HTTPie supports Basic auth (--auth user:pass), Bearer tokens (Authorization:Bearer token), digest auth, and custom authentication via plugins. Sessions persist auth headers across requests.

Can I use HTTPie in scripts?+

Yes. Use --print=b for body-only output, --check-status to fail on HTTP errors, and --quiet for silent mode. HTTPie returns appropriate exit codes for scripting and can output raw responses without formatting.

Does HTTPie support HTTPS?+

Yes. HTTPie handles HTTPS by default, verifying SSL certificates. Use --verify=no to skip verification for self-signed certificates during development.

Is there a GUI version of HTTPie?+

Yes. HTTPie offers a desktop application and web-based interface at httpie.io. The GUI provides the same intuitive experience with a visual request builder. The CLI and GUI share the same core engine.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets