HTTP/2 support for HTTPie

by Javier Garza
2352

HTTPie is a great command line tool for working with HTTP-based APIs. If you’re just getting started, check out the earlier post I wrote on Setting Up HTTPie for Akamai.

HTTP/2 (h2) is the new version of the HTTP Protocol, and in this follow-up I explain how to enable HTTP/2 support for HTTPie.

Enabling HTTP/2 Support for HTTPie

First you need to see if your HTTPie client has HTTP/2 support already. You can do this from a terminal window.

Open a Terminal window and type the command below:

Look for the HTTP protocol version before the “200 OK” response. If you see “HTTP/1.1” then you need to follow the instructions below to enable support for HTTP/2).

Install HTTP/2 support on HTTPie

To install the HTTP/2 plugin for HTTPie, open a Terminal window and type the command below:

Verify HTTP/2 support on HTTPie

Now repeat the same request we did earlier and confirm you see “HTTP/2” in the protocol version.

That’s all there is to it, have fun with HTTP/2!

Additional Resources

To learn more about HTTP/2, see the O’Reilly book Learning HTTP/2.

Categories: Technology

Suggested Article