Today, we are excited to announce that Postman now supports WebSocket APIs. This key update to our API platform is currently available in public beta with Postman v8.5 and above.
Support for the WebSocket protocol is one of the most popular feature requests we’ve received from the Postman community. The protocol enables continuous two-way communication between your browser and the web server, and for Postman, it has meant the advent of a whole new paradigm of asynchronous APIs.
In the latest version of Postman, you can now hit the “New” button in the left sidebar and open a WebSocket Request tab. In this tab, you can input your WebSocket API URL, establish a connection, then send and receive messages seamlessly. Take it for a spin and give us feedback in our WebSocket discussion forum.
From the very beginning, we noticed that the most arduous thing getting in the way of using WebSocket APIs is the very act of connecting to a WebSocket API server. To solve this problem, we leveraged what we do best—we used our knowledge of HTTP APIs and built a powerful interface that allows you to highly customize and debug the first connection (handshake) call that you make with the server. And, if you face issues connecting to your WebSocket API, Postman shows you detailed information of the handshake process.
You can customize headers and query parameters needed to make your WebSocket connection. Postman automatically adds the basic WebSocket headers needed to connect.
Sending and receiving WebSocket messages
Our second order of business was to provide a powerful search on the stream of WebSocket messages coupled with an easy way to send and preview the contents of these messages.
Once connected, you can use the Message Editor to compose your messages. The extra-large compose area with the ability to syntax highlight and auto-format JSON and XML makes it super easy to send WebSocket messages. You can even compose raw ArrayBuffer messages, which was something we found handy while debugging a few of our WebSocket APIs.
Pro Tip: You can use your favorite cmd/ctrl+enter keyboard shortcut to send the messages.
The messages you send or receive from the WebSocket API show up in the unified message timeline right below the Message Editor. This timeline shows you previews to quickly find the message you are interested in. Subsequently, for the messages you want to dig deeper into, you can expand the message preview and be greeted by the same powerful Message Editor with syntax highlighting and comprehensive search functionality.
The timeline is accompanied by convenient overall search and filter options that help you reduce noise in a very chatty WebSocket API and get to the exact message you are interested in.
Reusing and collaborating on your WebSocket APIs
You can revisit your previous WebSocket sessions within the History section of the Postman sidebar. This allows you to not just revisit a previous session to peek into the messages but also reuse the same API by hitting the “Connect” button.
Pro Tip: If you are working on a shared workspace, others in your workspace can also revisit your WebSocket message history and reuse an API.
We’re constantly working to improve the Postman API Platform with the capabilities you need, and WebSocket support is just the latest example of this commitment. Adding documentation functions, scripting, testing, and every other feature that we all love in Postman are our top priorities. So, as an ongoing effort, we intend to support WebSocket subprotocols (such as Socket.io) for a more advanced search, filter, and grouping of messages, and to add a plethora of helpful debugging utilities.
This powerful addition in Postman would not have been possible without the thousands of upvotes, ideas, and feedback that we received from you—our community. We would love to hear your continued feedback so that we can keep creating and evolving what helps you to build faster and better. We invite you to participate in the Postman Community forum discussion around WebSocket support and follow our GitHub issue tracker link in order to talk to us about improvements, ideas, and issues. We also recommend that you check out our Learning Center documentation for WebSockets to know more about how to use Postman for WebSocket APIs and to suggest documentation improvements you would like to see.
If you like what we are building here at Postman and want to join our team, we encourage you to explore our open positions.