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.
|
Version
|
1.0.2
|
|
Last update
|
2/15/2018
|
|
HTTPie version
|
0.9.8
|
|
GET
|
http localhost:8080 |
|
GET
|
|
|
Help
|
http --help |
|
POST form
|
http -f POST localhost:8080 name=value |
|
POST json
|
http POST localhost:8080 name=value |
|
POST json
|
http -j POST localhost:8080 name=value |
|
POST json
|
http POST localhost:8080 < data.json |
|
PUT
|
similar to POST
|
|
DELETE
|
similar to GET
|
|
Display request & response (verbose)
|
http -v localhost:8080 |
|
Download
|
http localhost:8080/file > file |
|
Download wget style
|
http -d localhost:8080/file |
|
Upload
|
http localhost:8080 < file |
|
Set headers
|
http localhost:8080 User-Agent:Bacon/1.0 'Cookie:valued-visitor=yes;foo=bar' X-Foo:Bar Referer:http://httpie.org/ |
|
Default HTTPie request headers
|
GET / HTTP/1.1
Accept: / Accept-Encoding: gzip, deflate User-Agent: HTTPie/<version> Host: <taken-from-URL> |
|
List of headers
|
|
|
Common request headers
|
Host, User-Agent, Accept, Accept-Language, Accept-Encoding, Accept-Charset, Keep-Alive, Pragma, Cache-Control, Cookie, Content-Type, Content-Length
|
|
Basic auth
|
http -a username:password POST localhost:8080 |
|
Basic auth (pw prompt)
|
http -a username POST localhost:8080 |
|
Basic auth (empty pw)
|
http -a username: POST localhost:8080 |
|
Digest auth
|
http -A digest -a username:password POST localhost:8080 |
|
Auth plugins
|
OAuth, SPNEGO, NTLM, JWT, more
|
Nice! You should include the shortcut for localhost, so instead of localhost:8000 you can just type :8000
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.