Show Menu

HTTPie Cheat Sheet by

HTTPie—aitch-tee-tee-pie—is a command line HTTP client with an intuitive UI, JSON support, syntax highlighting, wget-like downloads, plugins, and more.
web     software     httpie

Cheatsheet version

Version
1.0.2
Last update
2/15/2018
HTTPie version
0.9.8

Instal­lation

Get the installer at httpie.org

Basic usage

GET
http localh­ost­:8080
GET
http http:/­/lo­cal­hos­t:8080
Help
http --help
POST form
http -f POST localh­ost­:8080 name=v­alue
POST json
http POST localh­ost­:8080 name=v­alue
POST json
http -j POST localh­ost­:8080 name=v­alue
POST json
http POST localh­ost­:8080 < data.json
PUT
similar to POST
DELETE
similar to GET
Display request & response (verbose)
http -v localh­ost­:8080
Download
http localh­ost­:80­80/file > file
Download wget style
http -d localh­ost­:80­80/­file
Upload
http localh­ost­:8080 < file
 

HTTP request headers

Set headers
http localh­ost­:8080 User-A­gen­t:B­aco­n/1.0 'Cooki­e:v­alu­ed-­vis­ito­r=y­es;­foo­=bar' X-Foo:Bar Refere­r:h­ttp­://­htt­pie.org/
Default HTTPie request headers
GET / HTTP/1.1
Accept: /
Accept­-En­coding: gzip, deflate
User-A­gent: HTTPie/<version>
Host: <ta­ken­-fr­om-­URL>
List of headers
Common request headers
Host, User-A­gent, Accept, Accept­-La­nguage, Accept­-En­coding, Accept­-Ch­arset, Keep-A­live, Pragma, Cache-­Con­trol, Cookie, Conten­t-Type, Conten­t-L­ength

Authen­tic­ation

Basic auth
http -a userna­me:­pas­sword POST localh­ost­:8080
Basic auth (pw prompt)
http -a username POST localh­ost­:8080
Basic auth (empty pw)
http -a username: POST localh­ost­:8080
Digest auth
http -A digest -a userna­me:­pas­sword POST localh­ost­:8080
Auth plugins
OAuth, SPNEGO, NTLM, JWT, more

Download the HTTPie Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/clucinvt_httpie.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

FluxSauce FluxSauce, 20:01 30 Mar 18

Nice! You should include the shortcut for localhost, so instead of localhost:8000 you can just type :8000

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          CSS2 Cheat Sheet
          JavaScript Cheat Sheet

          More Cheat Sheets by clucinvt