Friendly and fast tool for sending HTTP requests
xh is a friendly and fast tool for sending HTTP requests. It reimplements as much
as possible of HTTPie's excellent design, with a focus
on improved performance.
curl -sfL https://raw.githubusercontent.com/ducaale/xh/master/install.sh | shiwr -useb https://raw.githubusercontent.com/ducaale/xh/master/install.ps1 | iex| OS | Method | Command |
|---|---|---|
| Any | Cargo* | cargo install xh --locked |
| Any | Huber | huber install xh |
| Any | Mise | mise use xh --global |
| Android (Termux) | pkg | pkg install xh |
| Android (Magisk/KernelSU) | MMRL** | mmrl install xhhttp |
| Alpine Linux | apk*** | apk add xh |
| Arch Linux | Pacman | pacman -S xh |
| Debian & Ubuntu | Apt**** | sudo apt install xh |
| Fedora | Copr***** | sudo dnf install xh |
| FreeBSD | FreshPorts | pkg install xh |
| NetBSD | pkgsrc | pkgin install xh |
| Linux & macOS | Nixpkgs | nix-env -iA nixpkgs.xh |
| Linux & macOS | Flox | flox install xh |
| Linux & macOS | Homebrew | brew install xh |
| Linux & macOS | Hermit | hermit install xh |
| macOS | MacPorts | sudo port install xh |
| Windows | Scoop | scoop install xh |
| Windows | Chocolatey | choco install xh |
| Windows | Winget | winget add ducaale.xh |
* Make sure that you have Rust 1.85 or later installed
** You will need to install the MMRL CLI
*** Built with native-tls only.
**** Available since Debian 13 and Ubuntu 25.04. Built with native-tls only.
***** Enable COPR repo via sudo dnf copr enable ducaale/xh
The release page contains prebuilt binaries for Linux, macOS and Windows.
…Run xh help or man xh for more detailed information.
xh uses HTTPie's request-item syntax to set headers, request body, query string, etc.
=/:= for setting the request body's JSON or form fields (= for strings and := for other JSON types).== for adding query strings.@ for including files in multipart requests e.g [email protected] or [email protected];type=image/jpeg;filename=goodbye.jpg.: for adding or removing headers e.g connection:keep-alive or connection:.; for including headers with empty values e.g header-without-value;.An @ prefix can be used to read a value from a file. For example: x-api-key:@api-key.txt.
The request body can also be read from standard input, or from a file using @filename.
To construct a complex JSON object, a JSON path can be used as a key e.g app[container][0][id]=090-5.
For more information on this syntax, refer to https://httpie.io/docs/cli/nested-json.
Similar to HTTPie, specifying the scheme portion of the request URL is optional, and a leading colon works as shorthand
for localhost. :8000 is equivalent to localhost:8000, and :/path is equivalent to localhost/path.
URLs can have a leading :// which allows quickly converting a URL into a valid xh or HTTPie command. For example
http://httpbin.org/json becomes http ://httpbin.org/json.
xh http://localhost:3000/users # resolves to http://localhost:3000/users
xh localhost:3000/users # resolves to http://localhost:3000/users
xh :3000/users # resolves to http://localhost:3000/users
xh :/users # resolves to http://localhost:80/users
xh example.com # resolves to http://example.com
xh ://example.com # resolves to http://example.comxh will default to HTTPS scheme if the binary name is one of xhs, https, or xhttps. If you have installed xh
via a package manager, both xh and xhs should be available by default. Otherwise, you need to create one like this:
cd /path/to/xh && ln -s ./xh ./xhs
xh httpbin.org/get # resolves to http://httpbin.org/get
xhs httpbin.org/get # resolves to https://httpbin.org/getIf xh is invoked as http or https (by renaming the binary), or if the XH_HTTPIE_COMPAT_MODE environment variable is set,
it will run in HTTPie compatibility mode. The only current difference is that --check-status is not enabled by default.
…--curl flag.--help. (For longer output, pass help.)xh.nu completion script causes parser error on --generate flags in Nushell (nu::parser::missing_positional)
Any option to show 103 Early Hints responses?
Consider supporting reading http request from a file
Stabilise HTTP message signatures support
Show ALPN log with --verbose
Official fedora packages ?
.netrc support for arbitrary headers
Plugin system for extending supported auth methods
Add support for OAuth 2.0 authentication flows
`--stream` does not print entire buffer