用 xh 发送 HTTP 请求

用简洁语法发请求,并阅读彩色响应。

macOScurl 请求网络APIHTTPie低风险
运行 xh GET https://httpbin.org/get,获取并美化打印 JSON 响应。

01命令

命令
$ xh GET https://httpbin.org/get

02作用说明

xh 是 HTTPie 的 Rust 重实现,启动快且语法直观,例如 xh POST url key=value。它会为响应头、JSON 和 HTML 着色,支持文件和会话,也能用 xh --download 下载。

03风险

风险低风险
系统兼容性macOS with Homebrew installed
!注意: 响应体可能包含凭证或令牌,避免在共享 CI 输出中打印。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • Homebrew formula: xh
    Homebrew · vendor-doc · 2026-09-20
    依据: Friendly and fast tool for sending HTTP requests. Packages xh, a fast HTTP client inspired by HTTPie with a simpler syntax.

最后验证: 2026-09-22 · 分类: 网络