Back in 2009, our Leandro (a.k.a TatooKa) wrote an awesome post on how to use curl to do POSTs and other HTTP magic. Back then curl was the way to go when you wanted to do command line HTTP GET/POST/PUT. Nowadays there’s a simpler and more modern variation: httpie.
To install on Ubuntu just do:
$ sudo apt-get install httpie
Once installed, you can do a simple HTTP POST with form variables like so:
$ http --form POST api.myservice.com/auth/login username=guest password=secretpassword
as a response you would get something like this (a JSON response in this case):
As you can see the response is much cleaner: there’s color coding showing you the response headers, the body is detected to be a JSON object and its nicely formatted. To see many other cool examples go to its page on Github: https://github.com/jkbr/httpie











