← All posts

CLI

HTTPie: A Human-Friendly HTTP Client for the Terminal

HTTPie is a CLI HTTP client with intuitive syntax, JSON by default, and colorized output - curl for humans testing APIs.

H CLI

curl is the Swiss Army knife of HTTP, and its ergonomics show it - flags to remember, JSON to hand-encode, raw output to squint at. HTTPie is the friendly alternative built for the common case of poking at APIs. Its syntax is designed for humans: sensible defaults, JSON encoding out of the box, colorized and formatted responses, and a request that reads almost like a description of what you want.

Requests That Read Naturally

Fields and headers are just key=value and Header:value, and it assumes JSON so you don't hand-build payloads:

# A GET with a query param http GET api.example.com/tools category==CLI # A JSON POST - fields become a JSON body automatically http POST api.example.com/login user=me password=secret # Send and pretty-print JSON:API http GET devtools.example.com/jsonapi/node/dev_tool

Built for Exploring APIs

Colorized, formatted responses make it easy to read what came back, and features like sessions, auth helpers, and file uploads cover the real work of testing an endpoint. For quick API exploration it's simply faster to use than curl.

Rough Edges and Limitations

  • Not curl's universal reach. For exotic protocols or scripting ubiquity, curl is still the default.
  • It's a Python install. Slightly heavier than a single static binary.
  • Different syntax to learn. Worth it for interactive use; curl snippets won't translate directly.

For the everyday job of talking to a JSON API from the terminal, HTTPie is the one that gets out of your way.

Internal link suggestion: link "talking to a JSON API" to the jq post, since piping HTTPie output into jq is a natural combo.