Postman Now Supports Socket.IO
Today, Socket.IO users have a reason to celebrate. We hinted at this in our previous WebSocket announcement, but it’s finally here: we are excited to announce first-class support for Socket.IO in Postman. You can now test your real-time Socket.IO APIs in Postman for the web and Postman Canary, and the feature will be available in the native app with the next release in early August.
Socket.IO is one of the most popular libraries that enables real-time, bidirectional, and event-based communication between web clients and servers, using WebSockets under the hood. With many developers using Socket.IO in combination with HTTP APIs, now you can enjoy the benefits of Postman while switching between these two paradigms at will. This represents a big step for Postman in our goal to provide exceptional tooling and support for the WebSocket community.
Instead of repeatedly writing code to debug your Socket.IO API, you can now just open up Postman, connect to your server, and interactively debug the API in real time. And you’ll no longer be going in blind, because now you’ll have a plethora of tools and diagnostics right at your fingertips.
How to get started
If you’ve used raw WebSockets in Postman before, you’ll already be familiar with the user interface for Socket.IO. Here’s how you can establish a connection with your Socket.IO server in Postman—in just a few steps:
- In the left-hand sidebar, click New.
- Select WebSocket Request.
- Within the new tab’s header, click the drop-down that says Raw, and select Socket.IO instead.
- Type the address of your Socket.IO server into the URL bar.
- Click Connect.
In the near future, you’ll be able to save WebSocket and Socket.IO requests, so you won’t need to repeat these steps often. All of the servers you care about will be just a click away! Stay tuned for this update.
Listening on events
Now that you’re connected to your server, you need to listen for specific events. To do this, type an event name into the Listeners panel, and click “+” to add it. Since this is Socket.IO, you’ll only receive events that you’ve added listeners for. You can quickly disable and re-enable listeners with one click, making it easy and flexible to listen for different combinations of events that you’re interested in.
When you send or receive an event, it will appear in the unified event timeline, which shows you the entire history of a connection in one place. The timeline shows a preview of each event, giving you an overview of information, but you can dive into an event’s full contents by simply clicking to expand it.
Pro tip: Events in Socket.IO can have multiple arguments, so we’ve provided an argument selector for toggling between them (if there’s more than one).
At Postman, we really care about making the developer experience seamless (so many of us are developers ourselves, after all!), so the event timeline is packed with functionality. We’ve added a ton of powerful search and filtering options, so you can eliminate noise and hone in on exactly what you’re looking for. Additionally, all events are automatically color-coded, so you can visually parse through the different events with ease. You can even use the multi-select feature to instantly see the timing difference between two events, making it a breeze to analyze latency and other time-based issues.
Just like raw WebSockets, Socket.IO is bidirectional, which means you can send messages to the server whenever you’d like. You can type (or paste) your message into the Message Editor, type an event name, and click Send. Also, you can attach additional arguments to your events by clicking “+ Arg”.
Postman supports various input formats such as JSON, text, binary, and others, which you can toggle between at will. In fact, each argument can use a different input format. Keep your eyes peeled for even more input formats in the future.
What’s next for WebSockets and Socket.IO?
Socket.IO is a powerful new improvement for the Postman API Platform, but there is still much more ahead. Firstly, there are plenty more WebSocket subprotocols (not just Socket.IO) that would love to enjoy first-class Postman support. Secondly, WebSocket support (which includes Socket.IO) is still in beta, so we’ll be making constant improvements towards integrating WebSockets into the rest of the Postman ecosystem—so that we can take off that beta sticker. This includes adding documentation, scripting, testing, and every other feature that we love in Postman.
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 Socket.IO to know more about how to use Postman for Socket.IO 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.