Quick reference

HTTPie CLI Cheatsheet

A quick reference guide for HTTPie CLI tool: sending GET/POST requests, JSON payloads, form data, custom headers, auth methods, and output flags.

· Published

HTTPie is an intuitive, user-friendly command-line HTTP client with JSON support, syntax highlighting, and persistent sessions.

Basic Commands

http GET api.example.com/users
http POST api.example.com/users name="John Doe" email="john@example.com"
http PUT api.example.com/users/1 status="active"
http DELETE api.example.com/users/1

Request Items Syntax

Syntax Description Example
field=value String field in JSON or form name="Alice"
field:=raw_json Non-string JSON typed value (number, bool) age:=30 active:=true
Header:Value Custom HTTP request header Authorization:"Bearer token"
field@file.txt Embed file contents as field value summary@notes.txt
field@filename Form file upload (-f) avatar@profile.png
param==value URL query parameter limit==10 page==2

Authentication

http -a username:password api.example.com/protected # Basic auth
http -A bearer -a secret_token api.example.com/data  # Bearer token auth

Output Formatting & Downloads

http -v api.example.com/users          # Print entire HTTP exchange (headers & body)
http -h api.example.com/users          # Print response headers only
http -b api.example.com/users          # Print response body only
http -d api.example.com/archive.zip    # Download file with progress bar (like wget)
http -o myfile.tar.gz api.example.com/file # Output to custom filename

References

Related topics