# xh

> HTTP client that reimplements HTTPie's syntax with focus on improved performance and speed.

Stars: 8.2k · Language: Rust · License: MIT · Categories: Network

- Repository: https://github.com/ducaale/xh
- Page: https://www.trmn.sh/tools/xh

## Install

- Homebrew: `brew install xh`
- Cargo: `cargo install xh --locked`
- Apt: `sudo apt install xh`

## Overview

xh is an HTTP client that reimplements HTTPie's command-line interface with a focus on performance improvements. It provides a familiar syntax for sending HTTP requests with support for JSON and form data, headers, query parameters, and file uploads. The tool uses HTTPie's request-item syntax where `=` sets JSON fields, `==` adds query strings, `:` manages headers, and `@` includes files in multipart requests.

The tool supports advanced HTTP features including authentication (basic, bearer, digest), SSL/TLS configuration, proxy support, session management, and HTTP/2 and HTTP/3 protocols. It can stream responses, follow redirects, and download files with resume capability. xh includes URL shorthand notation where `:3000/users` resolves to `localhost:3000/users`, and supports HTTPS-by-default when invoked as `xhs`.

xh includes a strict HTTPie compatibility mode when invoked as `http` or `https`, making it suitable as a drop-in replacement. The tool can output curl command translations and generate shell completions. It's designed for developers, DevOps engineers, and API testers who need a fast, feature-rich HTTP client for testing and debugging web services.

### Installation

```bash
# via Homebrew
brew install xh
```

```bash
# via Cargo
cargo install xh --locked
```

```bash
# via Apt
sudo apt install xh
```

![xh demonstration](https://media.trmn.sh/cached/f3bb44d257754d41286cb02c836027b7760e934b4c1269c01ccf2c5f5497b87c.gif)

## Alternatives

- [trippy](https://www.trmn.sh/tools/trippy.md): Network analysis tool combining traceroute and ping functionality for diagnosing networking issues (Rust, 8.1k stars)
- [miniserve](https://www.trmn.sh/tools/miniserve.md): Single-binary, cross-platform CLI HTTP file server with auth, uploads, TLS, WebDAV, QR codes, and on-the-fly tar.gz/zip directory downloads. (Rust, 8.1k stars)
- [sshx](https://www.trmn.sh/tools/sshx.md): Shares a terminal session over the web with a single command, with real-time cursors, an infinite canvas of windows, and end-to-end encryption. (Rust, 7.7k stars)
- [websocat](https://www.trmn.sh/tools/websocat.md): Command-line WebSocket client and server, like netcat, curl and socat for ws:// and wss://, with TCP/UNIX socket proxying and program execution. (Rust, 8.7k stars)
- [spotify_player](https://www.trmn.sh/tools/spotify-player.md): Terminal Spotify client with streaming, Spotify Connect remote control, synced lyrics, audio visualization, daemon mode, and CLI commands. Requires Premium. (Rust, 7.3k stars)

## Guides

- [Modern Replacements for curl](https://www.trmn.sh/replace/curl): Replace curl with xh, HTTPie, curlie or Posting: HTTPie-style request syntax, formatted output, and a TUI option for saved requests.
- [Best HTTP Clients for the Terminal](https://www.trmn.sh/best/http-clients): Compare HTTPie, xh, curlie and Posting: CLI and TUI HTTP clients for testing REST APIs from the terminal.

---

Canonical: https://www.trmn.sh/tools/xh
