March 13, 2017   

HTTPie is a useful HTTP CLI client with sensible defaults, built-in JSON support via an expressive and intuitive command syntax.

On OSX, you can install using HomeBrew - brew install httpie and invoked using http.

Favorite oneliners

Upload a file using redirected input

http < file.json

Download a file

http > file

http --download

Send API data from file

http POST < person.json

Basic Auth

http -a username:password

Digest Auth

http --auth-type=digest -a username:password

With Password Prompt

http -a username

Custom HTTP method HTTP headers and JSON data:

http PUT X-API-Token:12345 name=Pavan

Submitting forms:

http -f POST hello=World