Postman Now Supports WebSocket APIs

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.

Getting started

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.

Connecting to WebSocket API using Postman
Connecting to WebSocket API using Postman

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.

Working with WebSocket Messages
Working with WebSocket messages

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.

Searching for WebSocket Messages
Searching for WebSocket messages

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.

Revisit previous WebSocket message history
Revisit previous WebSocket message history

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.

What’s next?

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.

Try Postman now

What do you think about this feature? Tell us in a comment below. You can also give product feedback through our Community forum and GitHub repository.

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

22 thoughts on “Postman Now Supports WebSocket APIs

    How can we send Stomp subscribe request? I am able to connect it but I wanted to subscribe some topic endpoint

    Is there any due date regarding “Save” option for web socket requests?

      Hi Tomasz, We’re currently working on this feature but there isn’t an ETA yet. You can see other user feedback around this, and add your own, to our community-feedback post here.

    I can see that only ws protocols are only supported, So, when I am trying to connect via http it is not working.

    can you develop assert function in the websocket

    Is it possible to add a .pfx certificate to a websocket request? If yes, how to do it?

      Not at the moment, but we’ve just logged a feature request because of your comment—thank you for the feedback. You can follow the issue tracker for updates here.

    Does this new release support secure websockets (wss) with certificates based authentication?

    I’m trying to connect from postman to my hub (I’m using signalR and asp.net core 5),but it always returns Disconnect !! .SignalR hub expects connectionId from the client whish isn’t exist in postman !

    Not useful thus far. CTD each time I try to connect to a v4 socketio server. Hoping it’s fixed soon, would be nice to have a testbed.

    I wanted a feature that could send custom messages at certain intervals to maintain links, because my links would break if I didn’t send messages for a while.

    If I have a server that adds an endpoint with SockJS compatibility, postman is unable to connect to such a server. Only if I remove sockJS support, Postman is able to connect. But this is not desired, as we are developing the backend server to be consumed by front end browser based clients and we do need SockJS as a fall back mechanism. How do I enable Postman to connect to a server that has SockJS as fall back mechanism?

    How to change Upgrade Header in WebSocket Connection establishment? My server Need to be “janus-protocol” instead of “websocket”.

    Is it possible to write testscripts for websockets in postman, If so how?

    can you tell me how to subscribe to topic ? thank you

      Hello, you can’t currently subscribe to a topic; you can use the search to find posts on a topic or click on a tag to see related posts.

    in my opinion, it will only be widely used when there is a stomp client implementation out of the box.

    how can we export websocket collection just like http ? if yes can we execute that via newman

    How can we pass token during WebSocket connection call through postman?

    I create the web socket and it was hosted in local . But , whenever I to connect to the web socket using this end point ws://localhost:8080/ws/liveData . I could not be connect it returns this error Error: Unexpected server response: 404
    Handshake Details
    Request URL: http://localhost:8080/ws/liveData
    Request Method: GET
    Status Code: 404 Not Found
    Request Headers
    Sec-WebSocket-Version: 13
    Sec-WebSocket-Key: ETisbYrb0W6GyVwcf+yyow==
    Connection: Upgrade
    Upgrade: websocket
    accessid: b9ab5771-3743-426e-b46c-cbf5957296ce
    Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
    Host: localhost:8080
    Response Headers
    Date: Fri, 05 Apr 2024 05:17:07 GMT
    Server: Apache
    Content-Length: 196
    Content-Type: text/html; charset=iso-8859-1
    Online
    . . But I try to connect this end point in other socket tool means connected well but I cannot able set the custom header . So , I use the postman app but I can’t able to connect .