Overview
Interacting with REST APIs, testing webhooks, or debugging local HTTP services on Android typically requires either the verbose, complex argument syntax of curl or bulky graphical API test apps.
Maintained by Magisk-Modules-Alt-Repo (packaging the open-source xh project by ducaale), xhhttp brings the popular xh command-line HTTP client directly to rooted Android devices. Built in Rust to reimplement the beloved user experience of HTTPie, xh provides a delightfully intuitive terminal interface for sending web requests, inspecting JSON payloads, and managing REST interactions.
Syntax & Practical Examples
The executable is named xh and operates seamlessly in any root shell, Termux console, or ADB session.
1. Simple GET Request with Formatted Output
su -c xh httpbin.org/json
(Automatically formats and highlights JSON fields, status codes, and response headers).
2. Sending JSON Payloads
Construct JSON objects without escaping tedious quotation marks:
su -c xh POST httpbin.org/post name="Android Root" status:=true version:=15
3. Setting Custom Headers & Authentication
su -c xh GET api.example.com/user "Authorization: Bearer <token>" "Accept: application/json"
4. Curl Translation Mode
Curious what the corresponding raw curl command looks like? Append --curl:
su -c xh --curl POST httpbin.org/post user=admin
Installation & Verification
- Download the latest
xh-magisk-module.zippackage from GitHub releases. - Flash the module in Magisk.
- Reboot your device.
- Verify the executable in your terminal:
su -c xh --version
