Ah, curl. While widely-loved and wildly powerful, its ergonomics leave something to be desired. Although it should not replace curl in your automation, HTTPie provides a much more human-friendly interface for testing endpoints, downloading files, submitting forms, and a whole lot more.

Installation

Most Linux distributions provide HTTPie via your system package manager. It is available on macOS via Homebrew or MacPorts, and via pip for Windows and all platforms mentioned above. Check out the documentation here for a full list of options and use-case examples.

Below I've provided a few of my favorite features.

Try it!

Want to test out that new endpoint configuration without repeatedly modifying your /etc/hosts file? No problem! Just supply the Host: option to specify the hostname that should be passed as part of the request.

http localhost:8000 Host: example.com

Want to see what the request looks like before sending it? Tack on the --offline option!

HTTPie with the --offline option

Looking for a wget-style file downloader? You got it!

http --download https://github.com/jakubroztocil/httpie/archive/master.tar.gz
HTTPie with the --download option

Gone are the days of escaping ampersands in your query string parameters and manually URL-escaping special characters.

http --offline https://api.github.com/search/repositories q==httpie+in:name per_page==1
HTTPie escape ampersand

Wrap up

I hope you find this helpful, and please share any other command-line tools that have changed your day-to-day tasks recently! A couple of other favorites of mine are ripgrep and choose.

[ Want to test your sysadmin skills? Take a skills assessment today. ]


執筆者紹介

Jonathan Roemer is a senior DevOps engineer at Drizly with an interest in security, automation, and the human side of IT. He can usually be found hiking or reading a book on his porch.

UI_Icon-Red_Hat-Close-A-Black-RGB

チャンネル別に見る

automation icon

自動化

テクノロジー、チームおよび環境に関する IT 自動化の最新情報

AI icon

AI (人工知能)

お客様が AI ワークロードをどこでも自由に実行することを可能にするプラットフォームについてのアップデート

open hybrid cloud icon

オープン・ハイブリッドクラウド

ハイブリッドクラウドで柔軟に未来を築く方法をご確認ください。

security icon

セキュリティ

環境やテクノロジー全体に及ぶリスクを軽減する方法に関する最新情報

edge icon

エッジコンピューティング

エッジでの運用を単純化するプラットフォームのアップデート

Infrastructure icon

インフラストラクチャ

世界有数のエンタープライズ向け Linux プラットフォームの最新情報

application development icon

アプリケーション

アプリケーションの最も困難な課題に対する Red Hat ソリューションの詳細

Virtualization icon

仮想化

オンプレミスまたは複数クラウドでのワークロードに対応するエンタープライズ仮想化の将来についてご覧ください