Instead of curl: xh
Use xh when you are testing or poking at an HTTP API by hand. It builds JSON bodies from key=value pairs, formats and colours the response, and ships as one static binary. curl remains the right tool for scripts, downloads and anything beyond HTTP.
Both are for sending HTTP requests to an API by hand from the terminal.
Why xh is better
- Request bodies are short, so xh post httpbin.org/post name=ahmed age:=24 sends a JSON object without quoting a JSON string.
- Responses are formatted and coloured by default, so JSON is readable without piping through jq.
- It reimplements HTTPie's syntax with faster startup and comes as a single statically linked binary.
- --curl prints the equivalent curl command, so you can try a request in xh and paste the curl version into a script.
- HTTP/2 is supported.
When to keep curl
Keep curl for scripts, CI, Dockerfiles and downloads. curl is installed almost everywhere, speaks far more than HTTP (FTP, SFTP, SMTP, IMAP, MQTT and more), supports HTTP/3, and its library libcurl runs in over twenty billion installations. Its flags are stable across decades.
Switching
Install xh and use it for interactive API calls. Headers are Name:value, string fields are key=value and other JSON types are key:=value. If you know HTTPie, the syntax is the same, and naming the binary http turns on HTTPie compatibility mode.
Watch out
xh is a small volunteer project. Its own README lists not all of HTTPie's features implemented, no plugin system, general immaturity and weaker documentation. Do not use it in shared scripts that teammates or servers may not have installed.
Also worth a look
- HTTPie The original friendly HTTP client that xh copies; pick it if you need its plugins, though its command-line repository has seen little activity recently.
More newer, better command-line tools
Sources
Judged on 2026-11-06. See every command-line tools, or all 66 replacements.