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


If you use drush and code modules/templates in Drupal you know the symptom: add a new template file, add a hook to your module, pretty much change a few things in your code and you issue a drush cc all ‘just in case’. Drupal has an extensive cache system which is your friend but unfortunately when coding you often have to clear it so that the new changes can be detected. This constant ‘clear all caches’ can really slow you down. On large sites a drush cc all can take as long as 15-20 seconds to complete. If you are not sure your overriding the correct template or hook then it can become a little annoying to waste so much time.





