Thunder Client — lightweight alternative to Postman
How Postman led me to create my own API Client called Thunder Client Extension for VS Code.
I run my own project, localmint.com, where I regularly update location data, which involves working with many crawlers and APIs. For the past few years, I’ve been using Postman to test APIs. However, recently, the Postman desktop client has become slow to load with each update, and its UI has become increasingly confusing.
So I started looking for other clients, which I found requires multiple clicks to make a simple api request and has complex UI. Then I searched the Visual Studio Code extension gallery and found REST Client extension which is popular but not a GUI based client. So I finally decided to create my own API client.
Since I use Visual Studio Code regularly for development, I decided to create an extension instead of separate software to download aiming to avoid context switching. Additionally, millions of users already use VS Code, and it works cross-platform. I set the following design targets for the new extension:
Extension Design Goals
- Lightweight API Client
- Simple, Clean & Easy to use UI
- Local Storage
- Support VS Code Themes
- Collections & Environment Variables
- Scriptless Testing
Development
I started initial research on how to use VS Code api to develop an extension for couple of days and then started developing the software. Finally able to complete the development of Extension with the above target functionality. below is the screenshot of the extension
Scriptless Testing
I noticed that we often have to write a lot of boilerplate code in Postman and other clients just to perform basic tests, such as checking if the status code is 200. To simplify this, I implemented a GUI-based testing solution that allows you to perform most standard tests easily by selecting options from dropdowns, without any need for scripting knowledge. Below is a screenshot of the tests.
- (Update) Set Environment Variable from the api response in Tests tab is possible now, please see github page for details.
The 5 test cases in the above screenshot took only few seconds to write, thats how easy it is to do testing in Thunder Client.
The same tests to do in scripting takes lot of time and knowledge of chai scripting is needed. Below is the code needed to do same tests in Postman. i have to do google search to find syntax for some tests.
// status code test
pm.test("Status code is 200", function () { pm.response.to.have.status(200);});// property check
pm.test("Property message contains Thunder Client", function () { var jsonData = pm.response.json(); pm.expect(jsonData.message).to.contains("Thunder Client");});// response content-type check
pm.test("Content-Type contains application/json", function () { pm.response.to.be.header("Content-Type", "application/json");});
Script based tests still useful in advanced scenarios but for standard tests too much overkill.
Thunder Client CLI (New)
Extension Links
- VS Code Extension : Download Extension
- Website: www.thunderclient.com
- Support: github.com
Feedback
Please download the extension and let me know what you like or any feedback. To report any bugs or feature requests visit the github support page.
Contact
You can reach me on Linkedin or Twitter