Exploring Postman Alternatives
Postman Overview
Postman is software I've been using for quite some time whenever I want to explore a new API I intend to work with - usually before I want to move that integration into application code.
One of the pillars of Postman is the concept of Collections - a housing for a set of requests, and Environments - these are variables that you can reference anywhere throughout your requests (from URL, to headers, body, etc) using double-curly brace syntax. For example, if I made a variable "baseUrl", it my request URL I could reference {{baseUrl}}, and the value of the currently selected environment would get substituted when you run the request. Quite nice, really.
In addition to using Postman before you start working with an API, it can be a good documentation mechanism when you want to share with your customers how to use the API you've built. You export the collection and environment into JSON format and they can easily import it on their end to start playing with.
Why Look for Alternatives?
Recently Postman made a change in that in order to keep using Collections and Environments, you need to be signed into a Postman account, and the net result is all that data is synchronized to their servers.
On the subject of Environments, they have the concept of "Initial Value" and "Current Value". The current value is not synchronized, only the initial value - so it is possible that you set it up in such a way nothing sensitive gets leaked by not using "initial values".
Postman did introduce the concept of a "Lightweight Client", but this doesn't allow the usage of collections or environments, so...
You can read more about this in the following discussion post: https://community.postman.com/t/forced-to-store-environments-on-postman-servers/52232
What Are Some Alternatives?
There are quite honestly quite a number of clients you could use - a quick Google search will turn up a number of options. But for this post, I wanted to focus on three different clients to give my takes. Those are:
- Insomnia
- HTTPie
- Thunder Client
It's worth saying from the outset - all these clients follow the same principal of collections and environments that can be used throughout your defined requests.
Insomnia
URL: https://insomnia.rest
The top level object in Insomnia is a Project. You create a new one by this little plus icon
In the centre pane, before any collections have been created you get some action buttons.
note: If you do Import from this point (from a Postman collection), the collection will just get the generic name of "Imported Workspace".
The other pattern you can follow is to create a blank collection, and then do the import process - which will effectively merge all the requests in. From the collection, the action to import a collection is accessible by "breadcrumbs" in the centre-top. After you complete this step all the requests will be added to your collection.
From within the collection, you would use this same Import action to load the environment in (if you have an export). This makes the environment only available for this collection.
On the left side-bar, at the top, is where the specific environment you want to use is selected. Here (below), it has Base Environment selected. I can edit the data in my environment
There is no distinction between current and initial value. You just get a JSON structure with key/value pairs. You edit the data by clicking the cog, alongside the environment selection.
One other comment, is that all the other tools use a nice data-grid component to manage this data.
HTTPie
URL: https://httpie.io/desktop
HTTPie has traditionally been a command line client for making HTTP requests, designed to be a drop-in replacement for curl, but some time back they introduced a desktop client - admittedly this is still flagged as being in "beta".
The top-level object in HTTPie is a "Space". To create a new space, it wants you sign-in (with GitHub). I haven't done this action.
For importing, it is quite obvious - the Import button is always down the bottom of the left side-bar.
The display isn't so nice as Insomnia that groups by nested folders - here it is shown as a single entry
Environment is presented in a datagrid in this client, however, the management of variables I didn't find that nice - all the environments are managed/grouped as a whole.
You can see that each environment just gets a new column. I could see "My Space" at the top, so my thought is that if you sign-in you can use Spaces as a way to make this more manageable.
Thunder Client
This is actually a VSCode extension. I think this is probably the closest to Postman in that it has support for test scripts, which I couldn't see support for in the other clients. I typically use these to store the access token in my environment so I don't need to manually put the value each time I want to use the protected resource. Caveat being, you would obviously have to adjust these as the postman objects won't be available in Thunder client :).
Probably my main issue would be that this is not a standalone client, but I can get past that :).
Install by searching the VSCode marketplace for identifier rangav.vscode-thunder-client.
Once installed, you will get a new icon in your left panel
You can similarly import - go to the relevant tab
Conclusion
All things considered, I think Thunder Client will be my new go-to. I haven't done much with it yet, but I plan to give it a red-hot go!
Credits
Opening Splash Photo by Kristina Tripkovic on Unsplash