HTTPie Cheatsheet - HTTP Client
While debugging REST APIs, HTTPie auto-highlights and formats the request and response, and lets you write query strings with == and headers with :, which reads far better than curl. This table covers GET/POST, JSON sending, form uploads, Basic/Bearer auth, and cross-request session persistence for most integration work.
Basic Requests 7
http GET https://api.example.com/usersSend a GET request
http https://api.example.com/usersGET by default (no method)
http POST https://api.example.com/users name=John age:=30POST JSON (:= for number type)
http PUT https://api.example.com/users/1 name=JanePUT to update a resource
http DELETE https://api.example.com/users/1DELETE request
http PATCH https://api.example.com/users/1 email=new@mail.comPATCH partial update
http HEAD https://api.example.com/usersHEAD (headers only)
Headers & Params 7
http https://api.example.com X-Token:abc123Add a custom header (: separated)
http https://api.example.com X-Token:abc123 Cookie:session=xyzAdd multiple headers
http https://api.example.com page==2 size==10Query string params (== separated)
http -j https://api.example.comForce Content-Type to JSON
http -f https://api.example.com field=valueSubmit a form-urlencoded body
http -v https://api.example.comShow full request and response headers
http -p Hh https://api.example.comShow request(H) and response(h) headers only
Auth & Session 6
http -a user:pass https://api.example.comBasic auth
http -A bearer -a TOKEN https://api.example.comBearer token auth
http -A digest -a user:pass https://api.example.comDigest auth
http --session=logged-in https://api.example.comCreate and use a named session
http --session=logged-in https://api.example.com/profileReuse session cookies and headers
http --session-read-only=logged-in https://api.example.comRead-only session (no update)
Files & Downloads 6
http -d https://example.com/file.zip -o file.zipDownload a file (-d mode)
http --download https://example.com/file.zipDownload with a progress bar
http POST https://api.example.com/upload file@./photo.jpgUpload a file (@ prefix)
http POST https://api.example.com/data @data.jsonRead request body from a file
http -d https://example.com/file.zip --continueResume a partial download
http POST https://api.example.com/upload file@./photo.jpg field=valueUpload a file and fields together
Output & Formatting 6
http https://api.example.com | jq ".data"Pipe to jq to extract fields
http -b https://api.example.comResponse body only
http -h https://api.example.comResponse headers only
http --pretty=none https://api.example.comDisable formatting and highlighting
http -o response.json https://api.example.comSave the response body to a file
http --stream https://api.example.com/streamStream output (SSE/long-poll)
Tips & Tricks 5
http --proxy http:http://127.0.0.1:7890 https://api.example.comSend a request through a proxy
http --follow https://example.com/redirectAuto-follow redirects
http --timeout=30 https://api.example.comSet a 30s timeout
http --verify=no https://self-signed.example.comSkip SSL certificate verification
http --check-status https://api.example.com/usersNon-zero exit on 4xx/5xx status
Tips
- Install: pip install httpie or brew install httpie.
- := for JSON number/bool, == for query params, = for JSON string field.
- HTTPie pretty-prints and highlights JSON, easier than curl | jq.
- --session saves cookies and auth for multi-step API debugging.
- Item syntax: Header:Value, param==value, field=value, field:=value, file@/path.
- Use -o to save the body; pair with --download for large files with progress.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 19, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us