Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
X

xh

> 测试质量
Open source

Friendly and fast tool for sending HTTP requests

8.0K stars0 likes1 views
WebsiteGitHub

About

Friendly and fast tool for sending HTTP requests

xh

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.

Installation

via cURL (Linux & macOS)

bash
curl -sfL https://raw.githubusercontent.com/ducaale/xh/master/install.sh | sh

via Powershell (Windows)

iwr -useb https://raw.githubusercontent.com/ducaale/xh/master/install.ps1 | iex

via a package manager

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

via pre-built binaries

The release page contains prebuilt binaries for Linux, macOS and Windows.

Usage

…

Run xh help or man xh for more detailed information.

Request Items

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.

Shorthand form for URLs

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.

bash
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.com

Making HTTPS requests by default

xh 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:

bash
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/get

Strict compatibility mode

If 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.

Examples

…

How xh compares to HTTPie

Advantages

  • Improved startup speed.
  • Available as a single statically linked binary that's easy to install and carry around.
  • HTTP/2 support.
  • Builtin translation to curl commands with the --curl flag.
  • Short, cheatsheet-style output from --help. (For longer output, pass help.)

Disadvantages

  • Not all of HTTPie's features are implemented. (#4)
  • No plugin system.
  • General immaturity. HTTPie is old and well-tested.
  • Worse documentation.

Similar or related Projects

  • curlie - frontend to cURL that adds the ease of use of httpie
  • httpie-go - httpie-like HTTP client written in Go
  • curl2httpie - convert command arguments between cURL and HTTPie

Issues· 37 open

View all issuesOpen on GitHub
  • #473

    xh.nu completion script causes parser error on --generate flags in Nushell (nu::parser::missing_positional)

    Updated Aug 25, 2026
  • #385

    Any option to show 103 Early Hints responses?

    Updated Aug 16, 2026
  • #417

    Consider supporting reading http request from a file

    Updated Aug 5, 2026
  • #459

    Stabilise HTTP message signatures support

    Updated Jul 27, 2026
  • #389

    Show ALPN log with --verbose

    Updated Jul 11, 2026
  • #461

    Official fedora packages ?

    Updated Jun 19, 2026
  • #414

    .netrc support for arbitrary headers

    Updated Jun 3, 2026
  • #424

    Plugin system for extending supported auth methods

    Updated Jun 1, 2026
  • #284

    Add support for OAuth 2.0 authentication flows

    Updated Apr 10, 2026
  • #273

    `--stream` does not print entire buffer

    Updated Feb 13, 2026

> Tags

Rustapi-testingclideveloper-toolshttp-client

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category测试质量
PricingOpen source

> Related tools

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.