HTTPie is a user-friendly command-line HTTP client designed for testing, debugging, and interacting with APIs and HTTP servers. Unlike curl, HTTPie features intuitive syntax, formatted and colorized output, built-in JSON support, and sensible defaults that make working with web services a pleasure. It is the perfect tool for developers and sysadmins who frequently interact with RESTful APIs.
📑 Table of Contents
Key Features
- Intuitive Syntax – Natural command structure that mirrors HTTP semantics
- Colorized Output – Syntax highlighting for headers and body content
- JSON Support – Native JSON encoding and pretty-printing
- Sessions – Persist cookies and authentication across requests
- Forms and File Uploads – Easy multipart form submissions
- HTTPS and Authentication – Built-in support for SSL and various auth methods
Installation
# Using pip (recommended)
pip install httpie
# Debian/Ubuntu
sudo apt install httpie
# RHEL/CentOS/Fedora
sudo dnf install httpie
# Arch Linux
sudo pacman -S httpie
# macOS
brew install httpie
Common Usage Examples
# Simple GET request
http httpbin.org/get
# POST with JSON data
http POST api.example.com/users name=John email=john@test.com
# Custom headers
http example.com Authorization:"Bearer token123"
# Form submission
http -f POST example.com/login username=admin password=secret
# Download file
http --download example.com/file.zip
# With authentication
http -a username:password example.com/protected
Use Cases
HTTPie shines in API development and testing, debugging web services, scripting HTTP interactions, exploring RESTful endpoints, and any scenario where readable HTTP output is valuable.
Was this article helpful?