Skip to content
Latchkey

xh: Fast Rust HTTPie-Compatible HTTP Client

xh is a single-binary reimplementation of HTTPie in Rust, using the same request grammar with faster startup.

xh mirrors HTTPie's syntax (field=value, :=, ==, Header:value) but ships as one static binary with no Python runtime, which makes it quick to install on a minimal CI image.

What it does

xh sends HTTP requests with HTTPie-compatible syntax: xh GET url and xh POST url field=value behave like their http counterparts, including := for raw JSON and == for query params. It defaults to GET, colorizes JSON, and installs as a standalone binary with no interpreter.

Common usage

Terminal
xh GET example.com/api/users
xh :8080/health                       # method defaults to GET
xh POST example.com/api name=Ada active:=true
xh --follow GET example.com/

Options

Item / flagWhat it does
field=valueString JSON body field
field:=valueRaw JSON body field
name==valueURL query parameter
--followFollow redirects
--check-statusSet the exit code from the HTTP status
--timeout <sec>Request timeout

In CI

xh is convenient when you want HTTPie ergonomics without installing Python. There is also an xhs entry point that defaults to https, mirroring HTTPie's https. Like HTTPie, it does not follow redirects unless you pass --follow.

Common errors in CI

xh: error: error sending request for url (...): error trying to connect: tcp connect error: Connection refused (os error 111) means the target port has nothing listening yet. error trying to connect: dns error means the host did not resolve. A timeout surfaces as operation timed out; raise --timeout.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →