Still using the GET and HEAD commands? Meet httpie

I've been using libwww-perl's GET, POST and HEAD commands for the last ten years at least. Typing "GET -Used" is more or less muscle memory by now and my attempts and getting friendly with the curl command line has never bore fruit. libwww-perl is pretty ancient and it has some annoying snags and those of my friend who are using curl are not raving about their experiences either. 

Thanks to a post on hacker news a couple of week back I found something new and it is has changed a very, very, very small part of my life. Somewhat.

The program is called httpie with the slogan HTTP for humans. The most striking difference compared to the existing tools it uses colours where libwww-perl and curl are monochromatic. This makes it simple to mentally parse the output in your head.

For your regular inspection of the Varnish HTTP responses the useful command line is

$ http -p hH http://varni.sh/ user-agent:IE6

-H show the request headers.
-h shows the response header.

Extra headers are sent along in a key:value format after the URL. Changing the HTTP method is simple, it can be given as the first option to httpie, like this:

$ http HEAD http://varni.sh/

Installation

httpie is written in Python and can usually be installed with pip:
$ pip install httpie

If you are on a Linux system, chances are it is already packaged in your distro, you can do

$ apt-get install httpie

or

$ yum install httpie

You can read more about httpie on the httpie project home page.

26/06/14 11:19 by Per Buer

All things Varnish related

The Varnish blog is where the our team writes about all things related to Varnish Cache and Varnish Software...or simply vents.

SUBSCRIBE TO OUR BLOG

Recent Posts

Posts by Topic

see all

Varnish Software Blog