xh Friendly HTTP client
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
xh <url>xh <url> <k>=<v>
xh <url> <k>==<v>
xh <url> <h>:<v>
xh -f <url> <k>=<v>
xh -d <url>
xh :3000/<path>
xh -v <url>
Concepts
- URL scheme optional
- Items k:v k==v k=v
- Request JSON by default
- Response colored on tty
Requests
xh <url>xh post <url> <k>=<v>
xh put <url> <k>=<v>
xh delete <url>
xh <url> <k>=<v>
<k2>=<v2>
xh <url> <k>:=<json>
xh <url> <a>[<b>][0]=<v>
xh <url> <k>==<v>
xh <url> <h>:<v>
xh <url> <h>:
xh <url> <h>:@<file>
xh :3000/<path>
xh --raw '<body>' <url>
xh <url> < <file>
xh <url> -I < <file>
Forms and files
xh -f <url> <k>=<v>
xh --multipart <url> <k>=<v>
xh -f <url> <k>@<file>
xh -f <url>
<k>@<file>;type=<mime>
xh -f <url>
<k>@<file>;filename=<n>
xh -j <url> <k>=<v>
Output
xh -v <url>
xh -h <url>
xh -b <url>
xh -m <url>
xh -p <what> <url>
xh -q <url>
xh --pretty <mode> <url>
xh -s <theme> <url>
xh -S <url>
xh --curl <url>
xh --debug <url>
xh --offline <url> <k>=<v>
Auth
xh -a <user>:<pass> <url>
xh -a <user> <url>
xh -A bearer -a <token> <url>
xh -A digest -a <user>:<pass> <url>
xh --ignore-netrc <url>
Downloads and redirects
xh -d <url>
xh -d -o <file> <url>
xh -d -c -o <file> <url>
xh -F <url>
xh -F --max-redirects <n> <url>
xh -F --all <url>
xh -F -P <what> <url>
xh --check-status <url>
xh --no-check-status <url>
Sessions
xh --session <name> <url>
xh --session <file> <url>
xh --session-read-only <name> <url>
Network and TLS
xh --timeout <sec> <url>
xh --proxy <proto>:<url> <url>
xh --resolve <host>:<addr> <url>
xh --verify no <url>
xh --verify <ca.pem> <url>
xh --cert <file> --cert-key <key>
<url>
xh --https <host>
xh --ssl <version> <url>
xh --http-version <v> <url>
xh --unix-socket <path> <url>
xh -4 <url>
xh -6 <url>
xh -x <url>
Concepts and setup
xhs <url>xh --no-<option>
xh --generate <kind>
xh --helpxh --versionRecipes
# create, then fetch with a bearer tokenxh post api.example.com/items name=widget qty:=3 -A bearer -a $TOKENxh api.example.com/items -A bearer -a $TOKEN
# log in once, reuse the cookiexh --session=me -f post :8000/login user=ann pass=secretxh --session=me :8000/profile
xh -b api.example.com/items | jq '.[].name'xh --offline post :3000/x a=1 --curl
xh -F -d -o app.tgz example.com/app.tgzxh -f post example.com/up file@./app.tgz



