lang: zh
slug: httpie
title: ‘HTTPie: 38,200 GitHub Stars’
description: ‘HTTPie is a modern command-line HTTP client for the API era with JSON support, colors, and sessions. Compatible with Python, pip, Homebrew, Docker. Covers installation, benchmark comparison, production hardening, and FAQ.’
tags: [“automation”, “ci-cd”, “github”, “open-source”]
date: 2026-05-19 00:00:00+08:00
lastmod: 2026-05-19 00:00:00+08:00
tech_stack: []
application_domain: Dev Utils
source_version: ’'
licensing_model: Open Source
license_type: BSD-3-Clause
file_size: ’'
file_md5: ’'
download_url: ’'
backup_url: ’'
github_repo: ‘https://github.com/httpie/cli'
last_maintained: ‘2026-05-19’
draft: false
categories: [‘dev-utils’]
aliases:- /posts/httpie/
faqs:
q: ‘What is the difference between HTTPie and curl?’
a: ‘curl is a general-purpose data transfer tool supporting 20+ protocols and optimized for speed, while HTTPie is a Python-based HTTP client purpose-built for APIs with human-friendly syntax, native JSON support, and colorized output. For interactive API debugging HTTPie is faster to use, but for production scripts and large file transfers curl is more appropriate.’
q: ‘How do I send JSON data with HTTPie?’
a: ‘Use = for string fields and := for raw JSON types like numbers, booleans, arrays, and objects, for example: http POST api.example.com/users name=“John” age:=29 active:=true roles:=’’[“admin”]’’. HTTPie automatically sets Content-Type: application/json and serializes the data.’
q: ‘Does HTTPie support HTTP/2 and HTTP/3?’
a: ‘No. As of version 3.2.4, HTTPie only speaks HTTP/1.1 because it is built on Python’’s Requests library. For HTTP/2 or HTTP/3 multiplexing scenarios, curl is the appropriate tool.’
q: ‘How do I install HTTPie?’
a: ‘HTTPie requires Python 3.7 or newer and can be installed via pip with python -m pip install httpie. It is also available through Homebrew (brew install httpie), APT on Debian/Ubuntu, dnf/yum on Fedora/RHEL, Chocolatey on Windows, Docker, and as a standalone Linux binary.’
q: ‘Is HTTPie suitable for CI/CD pipelines?’
a: ‘Yes. Use the –check-status flag so HTTPie exits with error codes (3 for 3xx, 4 for 4xx, 5 for 5xx) that CI systems can detect, and always add –ignore-stdin in non-interactive environments to prevent hanging. Adding –timeout guards against unresponsive endpoints.’
featureImage: /images/articles/httpie-38200-github-stars-e900b539.png
——{{< resource-info >}}HTTPie (pronounced “aitch-tee-tee-pie”) is a command-line HTTP client designed for the API era. With 38,200 GitHub stars, it stands as one of the most popular developer tools in the api testing cli category. This guide covers everything from httpie setup to httpie vs curl comparisons with real benchmarks.
## IntroductionEvery developer has been there: staring at a wall of unformatted JSON spewed from curl, squinting to find the one field that matters, copying the output to a formatter just to make sense of it. The command-line HTTP tools of the 1990s were built for machines. HTTPie, created by Jakub Roztocil in 2012, was built for humans.In 2026, REST and GraphQL APIs dominate the web. JSON is the default language of data exchange. Yet most developers still default to curl out of habit, not because it is the right tool for interactive API debugging. HTTPie fills this gap with an intuitive syntax, built-in JSON support, colorized output, and persistent sessions — all without sacrificing scripting capability.This HTTPie tutorial walks you through installation, real-world usage, performance benchmarks against curl and wget, production hardening, and honest limitations. Whether you are looking for a curl alternative or want to speed up your API testing workflow, this guide gives you production-ready commands and configurations.## What Is HTTPie?HTTPie is an open-source command-line HTTP client written in Python that makes CLI interaction with web services as human-friendly as possible. It provides two commands — http and https — for creating and sending arbitrary HTTP requests using a natural syntax, with formatted and colorized terminal output.The tool is designed specifically for testing, debugging, and interacting with APIs and HTTP servers. Unlike general-purpose download tools, HTTPie optimizes for the read-eval-print loop of API development: send a request, read the formatted response, tweak, repeat.Key characteristics at a glance:| Attribute | Value |
|———–|——-|
| Language | Python (3.7+) |
| License | BSD-3-Clause |
| GitHub Stars | 38,200+ |
| Latest Version | 3.2.4 (Nov 2024) |
| Maintainer | HTTPie, Inc. |
| Default Content-Type | application/json |
| Platforms | Linux, macOS, Windows, FreeBSD |## How HTTPie Works### Architecture OverviewHTTPie sits on top of two well-known Python libraries:1. Requests — handles the actual HTTP transport (connection pooling, keep-alives, SSL, redirects)
Pygments — provides syntax highlighting for terminal outputWhen you run an HTTPie command, the tool performs these steps:1. Parse request items — headers (Name:Value), query params (name==value), data fields (name=value), raw JSON fields (name:=value), and file uploads (name@file)
Build the request — serialize data to JSON (default), form data (--form), or multipart (--multipart)
Send via Requests library — handle SSL, authentication, proxies, cookies
Format and colorize response — use Pygments for syntax highlighting based on Content-Type
Stream or buffer output — stream large files, buffer for formatted display
### Core Design PhilosophyThe command-line syntax maps directly to the HTTP request being sent. Compare this HTTP request:```
htt
p
POST /post HTTP/1.1
Host: pie.dev
X-API-Key: 123
User-Agent: Bacon/1.0
Content-Type: application/x-www-form-urlencoded
name=value&name2=value2
i
t
h
the HTTPie command:```
bas
h
http -f POST pie.dev/post \
X-API-Key:123 \
User-Agent:Bacon/1.0 \
name=value \
name2=value2
```T
h
e
order and syntax are n```
bas
h
http -f POST pie.dev/post \
X-API-Key:123 \
User-Agent:Bacon/1.0 \
name=value \
name2=value2
```i
o
/_next/static/media/hero-terminal.5a23ab28.svg)## Installation & Setup### PrerequisitesHTTPie requires **Python 3.7 or newer**. Verify your version:```
bas
h
python --version
```### Method 1: pip (Universal — Linux, macOS, Windows)````
bas
h
# 先升级pip和wheel
python -m pip install --升级 pip 轮# 安装 HTTPie
python -m pip 安装 httpie# 验证安装
http --版本
````### 我```
bas
h
蟒蛇——版本
````重击
酿造更新
酿造安装httpie# Upgrade later
brew upgrade httpie
g
s
/httpie.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" | \
sudo tee /etc/apt/sources.list.d/httpie.list > /dev/null# 安装
苏```
bas
h
酿造更新
酿造安装httpie
# 稍后升级
酿造升级httpie
``# 软呢帽
sudo dnf 安装 httpie# CentOS / RHEL
sudo yum install epel-release
sudo yum 安装 httpie
````#```
bas
h
# 添加官方 HTTPie 存储库
卷曲-SsL https://packages.httpie.io/deb/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/httpie.gpg
echo "deb [arch=amd64 签名者=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" | \
sudo tee /etc/apt/sources.list.d/httpie.list > /dev/null
# 安装
须藤apt更新
sudo apt安装httpie
``独立二进制文件
https --download packages.httpie.io/binaries/linux/http-latest -o http
ln -s ./http ./https
chmod +x ./http ./https# 现在直接使用./http和./https
./http https://api.example.com/users
````### 快速验证````
bas
h
$ http https://httpie.io/helloHTTP/1.1 200 好
内容类型:application/json{
"message": "你好,世界!"
}
````## 与 Popu```
bas
h
集成
# 软呢帽
sudo dnf 安装 httpie
# CentOS / RHEL
sudo yum install epel-release
sudo yum 安装 httpie
``处理器:````
bas
h
# 从 API 响应中提取特定字段
http 获取 https://api.github.com/repos/httpie/cli | jq '.stargazers_count, .forks_c```
powershel
l
choco 安装 httpie
# 升级
choco升级httpie
``e.com/posts | jq '.[] | {id:.id,标题:.title}'# 通过管道将 HTTPie 传输到 jq 传输到 HTTPie (chain```
bas
h
# 拉动并运行
docker run --rm httpie/cli https://httpie.io/hello
# 为了方便起见创建一个 shell 别名
别名 http='docker run --rm -it --net=host httpie/cli'
g
使用 HTTPie:````
bas
h
#!/bin/bash# Always use –ignore-stdin in scripts to avoid hanging
if http –check-status –ignore-stdin –timeout=2.5 HEAD example.com &> /dev/null; then
echo ‘Service is up’
el```
bas
h
💬 留言讨论