Skip to content
BENIBIX Learn

HTTPie

Development🔌 APIsHTTP Clients

Also known as HTTPie CLI, http command, HTTPie Desktop

A tool you type in a terminal to call APIs. Its commands are short and its replies are neat.

Think of it like

Think of it like a walkie-talkie for the web. You say a short line, and you get a neat reply.

Example

Jack tests his new endpoint with one line: http POST to /orders with item=mug. He sees the JSON answer in colour.

Why it matters

Quick checks of an API take seconds, without writing code.

Definition

HTTPie is a command-line tool for sending HTTP requests, made to be easy to read. You type http, the method and the address. Fields like name=Emma become JSON on their own. The answer comes back in colour and nicely spaced. It does many of the same jobs as curl, with shorter commands.

Example code

console
$ http POST api.example.com/orders item=mug qty=2
HTTP/1.1 201 Created
Content-Type: application/json

{
    "id": 43,
    "item": "mug"
}
Two fields become a JSON body, and the reply comes back tidy.
HTTPie sends the request from a terminal with the http command.

Common mistake

Expecting curl's flags to work. HTTPie has its own simpler way of writing requests.

Key takeaways

  1. 1
    Short commands. http, method, address, fields.
  2. 2
    JSON by default. Fields become a JSON body.
  3. 3
    Readable output. Colour and spacing.