Korean

xh — Modern HTTP Client

Linux / Modern CLI Tools / xh.html

Modern CLI ToolsOriginalRegistered 2026-01-19T18:00:00+09:00

💬 "xh command"

xh is a friendly HTTP command-line client that replaces curl. Without complex flags, xh example.com shows JSON, headers, and status codes in a readable form right away.

Written in Rust, it follows the HTTPie command style while being faster and lighter. It handles redirects, JSON/form posts, auth, and downloads with concise options.

  • Concept: Send HTTP requests from the terminal and print responses in a readable form.
  • Features: JSON/form posts, auth, header setting, redirect following, and file downloads.
  • Strength: Call APIs and inspect results with short commands instead of memorizing curl flags.
  • Use when: Checking REST APIs, inspecting web responses, or testing authentication.

Basic Usage

xh defaults to GET, and passing key=value pairs sends JSON automatically.

1. Basic request

URL only sends a GET and prints the result nicely.

xh example.com
xh example.com/users/1          # inspect JSON response

2. Sending data

key=value turns into a JSON POST.

xh POST example.com/users name=John age:=30 email:=null
xh POST example.com login form==true username=admin password=secret

3. Auth, headers, download

Handle tokens, headers, and files easily.

xh example.com Authorization:"Bearer TOKEN"
xh --download example.com/file.zip
xh -v example.com   # include headers

Installation & Download

xh installs via cargo, a package manager, or a release binary. It also provides http aliases.

EnvironmentCommand
cargocargo install xh
Ubuntu/Debian (if packaged)sudo apt install xh
macOS (Homebrew)brew install xh
Release binarygithub.com/ducaale/xh/releases

Verify with xh --version. To use the http and https aliases, create the symlinks suggested during install.

Common Options

Command / KeyDescription
POST/PUT/PATCHChoose the HTTP method
key:=valueSend as a JSON type (number, array, null)
key==valueSend as a URL query parameter
--downloadSave the response to a file
-vShow request and response headers in detail

3 Essential Command Combinations

  • xh example.com/api/health — Check an API response at a glance
  • xh POST api/login username=admin — Send a form/JSON login request
  • xh --download example.com/file.zip — Download a file

💬 "Using xh on a real server"

A step-by-step look at inspecting a local API.

Step 1 · Check service health

Check if the server is alive.

xh localhost:8080/health

Step 2 · Authenticated request

Call an auth endpoint with a token.

xh localhost:8080/api/me Authorization:"Bearer TOKEN"

Step 3 · Save the result

Store the response to a file.

xh localhost:8080/api/list --download resp.json

How it is used in practice

1. Health check

Situation — Verify service state after a deploy.

xh localhost:8080/health

Result — Status code and JSON body are visible at a glance.

Point — Check fast without memorizing curl flags.

2. Parameter testing

Situation — Test API with different query conditions.

xh 'example.com/api/items?limit==5&sort==desc'

Result — Attach queries easily with key==value.

Point — Try many combinations quickly to verify behavior.

Caveats

  • Quote URLs containing ? and & with quotes to be safe.
  • The default allows URLs without a trailing slash, but writing the exact path is good practice.
  • When using auth tokens they may land in shell history—consider temp files or env vars.