Postman v10 and gRPC: what you can do
Postman’s gRPC support started out with a single feature request in GitHub that received hundreds of upvotes, thumbs-ups, and positive reactions. When we began the journey of implementing gRPC support in Postman, we chose a few key features as our entry point. From there, we received amazing feedback from internal and external alpha users. Aside from feature requests, we also knew that we were onto something. The feedback was overwhelmingly positive and most asked for richer features.
Over the course of the next few quarters, we diligently added new features and continued to work with the community to smooth out the rough edges. During that time, we rolled gRPC into beta to expose it to a wider audience. Today, we are excited to officially include gRPC support as part of the launch of Postman v10! Now let’s walk through the features.
There are a few core features of gRPC support that make Postman the ideal place to work and build with gRPC. These include all the unary and streaming methods, server reflection, support for multi-file Protobuf, collaboration, testing, and mock servers.
Methods are at the heart of the core features, so we wanted to make sure that they were truly represented. Unary, client-streaming, server-streaming, and bidirectional-streaming are all gRPC-supported methods. In a previous blog post, Postman Technical Lead Josh Wise states:
Some methods in gRPC allow you to stream multiple payloads to the server, or allow the server to send multiple payloads in response. When using a method like this, Postman will automatically show a unified timeline of all events occurring on the connection. This gives you a complete view of what’s happening, which makes debugging a breeze.
We’ve added features for automatically generating example messages with a single click, autocomplete while composing messages, the ability to send metadata, and view incoming metadata.
One of the features we’re most excited about is automatic server reflection. Simply drop your gRPC URL into the URL bar and Postman does the rest! The services magically appear in the method dropdown.
A key feature request was the ability to support multi-file Protobuf definitions. Postman scans the imported Protobuf definition and fetches all the remaining .proto files without the need to import them individually.
What would gRPC support be in Postman without the collaboration being a core feature? Postman Collections are at the center of Postman’s collaborative tools. As I stated in our previous blog post:
Aside from simply sharing a workspace or collection with the team, the ability to fork collections, as well as duplicate and move requests now ensures that the full cycle of collaboration is met. Also, if you need to communicate changes, doubts or issues around a request, you can comment on gRPC requests.
Here are some of the key collaboration features:
- Synchronize the .proto files in your API with your repository
- Ability to save and document gRPC requests within collections
- Save, explore, and share gRPC request history
- Automatically generated request documentation
- Collaboration features like share, fork, comments, manage roles, and more
Ensuring an API is tested builds confidence in our work as engineers. It’s not surprising then, that we included testing gRPC methods as one of our core requirements. We added before-invoke and after-response scripts to automate and test methods and all unary and streaming methods are tested using Chai assertions to help you create robust tests around your gRPC methods.
To help get started with gRPC testing, we added a list of reusable snippets that can be chosen. In his recent blog post, Postman Technical Lead Appurva Murawat says:
Both before invoke and after response scripts come with pre-curated lists of commonly used code snippets that get added to your scripts when selected, helping you start quickly.
The creation of automatic mock servers was a huge win for gRPC users. We took out the tedious parts and simply created the mock server for you! Josh, who was our lead engineer on the gRPC project, says in his blog post:
As soon as the new endpoints have been designed and added to your Protobuf API, you already have a mock server implementing those endpoints. That’s right, you didn’t need to create a mock server—it’s just there. We mock both unary and streaming RPCs.
On the horizon
As we look on the horizon, gRPC support will only get better with new features. If you have feature requests or feedback for us, please let us know on GitHub. And keep coming back for more updates as we continue to push Postman gRPC support into the future!