The interest in API/Web services and their testing is gradually growing over the last couple of years. Having the right process, tool and solution for API are very important.
When we start building APIs one of the primary things we usually care to have is a good testing platform, that's easy to use and contains almost all the features that we would need.
There’s one more thing that usually gains the preference, and that is feature-rich GUI. Easy to use and less to code or type is preferable for most.
I have used a few clients and they are pretty good I must say. So let’s get to know a few of them, you can choose the one you feel is the best for you!
Explaining all of them would make this article long so I am going to add the most popular ones and also a link to their official page.
Insomnia:
Insomnia is a powerful REST API Client for Mac, Windows, and Linux.
It contains the basic features to test REST APIs like HTTP requests with add headers and authentication, obtaining the response and viewing the status, body, headers and cookies.
You can create different test suites for different hierarchies and template tags. Template tags are like environment variables but operate on strings, timestamps etc.
Insomnia has got some more cool features like cookie management, environment variables, code snippet generation in 12 different languages, and much more.
You can also view responses beyond JSON or XML, it can serve you image, audio, pdf, SVG and more.
One cool thing worth mentioning about this tool is it allows you to send a request after a delay or keep requesting after a certain time interval.
Postman
Postman is the most popular API testing tool in the market and it is more mature than Insomnia.
Now, I have been using Postman for quite some time, it never gave me a reason to move to another tool, to be honest. It has a real-time documentation generator which is very helpful when collaborating. You can add multiple requests grouped into a single collection and run it all together.
They named the collection runner as Newman which has a reference to the character Newman in Seinfeld who worked in the US Postal Service(Funny thing!).
Postman has monitoring features, you can write pre and post-request scripts for the APIs, and it also supports environment variables (global, collection, local).
It can also serve your responses in multiple formats (JSON, XML, images, PDFs HTML etc.).
Well to sum it up, Postman has got most of the things you would need, so go ahead and play around!
There are many more API testing clients which I will list at the end of this article, but first, let's look into a very niche use case.
Many companies are keen on using microservices for various good reasons. Smaller codebases, independently deployable and scalable and most importantly better performance and a great way to reduce downtime which means your application can still be running if one of the services fails.
When you are using more than one service, you need to make sure that there is a strong, reliable and fast method of communication between them.
A modern open-source high-performance Remote Procedure Call (RPC) framework that can run in any environment. Sounds interesting?
Well yes, I am talking about gRPC. It can efficiently connect services in and across data centres with pluggable support for load balancing, tracing, health checking and authentication. Some features of gRPC:
Simple service Definition.
Easy to set up and scalable.
Supports a variety of languages and platforms.
Bi-directional streaming and fully integrated pluggable authentication with HTTP/2-based transport.
gRPC uses Protocol Buffers, an open-source mechanism by Google for serializing structured data.
All you need is to define the structure for the data you want to serialize in a proto file: this is an ordinary text file with a .proto extension. A simple example of how your proto file might look like:
But where do you test it without the hassle of setting up the environment?
I have been beta-testing a wonderful GUI client for this and it serves the purpose best.
sConnector is a free hosted gRPC mock interface for testing,
This helps to play around with the gRPC protocol interface and its properties with some mock data. Navigate to their website, and download the tool for free. You can download it for Windows, Linux or Mac.
The instructions for using the tool are explained in an easy way on the official page of Techunits.
Techunits team are the creator of this amazing tool. They also have an informative blog that has articles on many topics that are updated regularly.
Once you have it installed the interface is pretty simple and you’ll understand how it works in a jiffy. It's extremely helpful for developers to create and test their distributed applications and services.
If you are looking for high-performance communication between your microservices or have multi-language environments, you don't have to force yourself on choosing a particular technology. So, try the sConnector and drop in your reviews on how you find it to be.
Update: gRPC is now available in Insomnia and Postman as well.
And like I mentioned, here are some more of the API testing tools that you might wanna have a look at if you are a perfectionist when selecting the right tools for your development purpose.