Postman vs Insomnia – why not both?

Just over a year ago I was emphatically singing the praises of Postman. Before that, I’d been using Fiddler to make calls to REST APIs and man, was that a drag! Recently I’ve had a similar experience when I discovered an alternative REST client called Insomnia. Unlike last time, however, I won’t be ditching the previous flavour of the month… Read on to discover why (for the time being at least) they both get a spot on my desktop.

First things first, it’s probably worth explaining what lead me to even look for an alternative to Postman. The truth is that I have been really happy with Postman on the whole. Recently, however, I’ve changed jobs and started working extensively with GraphQL (a topic on which I may in time write a post). Since GraphQL queries are just REST calls with a specific payload, it is, of course, entirely possible to perform them in Postman. That said, it just feels a bit clunky. When I Googled for tips on using Postman for GraphQL, the top result was this Stackoverflow answer, which had been edited to recommend Insomnia.

Now, I’m not an expert in either application, but I’ve been using Postman for a while now and I’ve used Insomnia quite a bit this week. I’ll try and do a comparison but I may well miss some things. If I do, let me know in the comments. Anyway, with that disclaimer out of the way, let’s get stuck in.

A screenshot showing a query and the response.

The Insomnia app running a simple GraphQL query against the (wonderful) FakerQL hosted endpoint.

The similarities

Even at first glance, there are a few similarities between the two: both have a panel on the left for saved requests, a pane for writing composing requests, and a pane for the response. Postman arranges these panes one above the other, but Insomnia defaults to placing them side by side. To my eye, Insomnia is almost a little stark when you first run it, but I suppose this plays to the simplicity of the aesthetic. Regardless, both make it pretty obvious how to write and run your first call.

The similarities are more than skin deep too:

  • Both are Electron apps, with the usual pros (e.g. cross-platform) and cons (e.g. large-ish footprint) that this entails.
  • They’re both “freemium” apps, with extra features (mainly around collaboration) available for subscribers.
  • Both have templating/tagging systems that allow for the management of multiple environments.
  • And both have ways of taking data from the response of one request and using it in another (via “test scripts” in Postman and “chaining” in Insomnia)

The differences

The first difference to highlight is obviously the one that drew me to Insomnia – GraphQL support. By selecting GraphQL as the body type in the drop down, Insomnia will immediately go and fetch the schema from the endpoint. The schema is then used to populate the auto-complete system, which makes composing queries very quick indeed. As well as all this, it quietly sorts all the headers out, so that everything just works. Let me put it this way: if you’re working with GraphQL, give Insomnia a try.

On the other hand, Postman has a much richer experience when it comes to operationally supporting an API in production. In Postman I’m able to write Javascript to run before and/or after a request so that I can things up and test the response. When combined with the ability to run Postman from the CLI (via Newman), you’ve got yourself a pretty nifty way to incorporate integration testing into your CI pipeline. There are also tools (which I’ve not used) to set up mock servers.

A future of coexistence?

As I work across different types of API – or even different aspects of the same API – I find myself switching from one app to the other. Luckily, this is made really easy by Insomnia’s ability to both import and export requests using Postman’s “Collection” file format.

Looking to the future, I predict Postman will start to imitate some of Insomnia’s GraphQL support. It is also possible Insomnia will get more of the sort of “enterprisey” features that Postman currently leads on. For my money though, the Postman team seem to be the more commercially focused. We’ll have to wait and see whether either or both of these things happen I suppose. For that matter, I suppose we should be wondering whether “one tool to rule them all” would even be a good thing.

Anyway, for the time being, I’ll continue to happily use both as required by the task at hand. There’s no such thing as the perfect tool, only the right tool for the job. Whilst Postman remains better suited to some tasks, I’ve moved all my GraphQL work into Insomnia. In general, I can foresee myself using both on a regular basis. Who knows, I may even find myself using Insomnia whilst wearing my Postman t-shirt

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.