Websocket API testing with Postman
Are you testing a Websocket API and are wondering if Postman can help you with this? Yes, sort of. Let’s explore together what Postman can and can’t do in terms of working with WebSocket APIs.
A very brief history
Historically speaking, Postman has been used as an HTTP client. It did not matter if you were working with a REST API, SOAP Web Services, or, more recently, GraphQL.
All these API architectural styles (if you can call it like that) had something in common: HTTP. This protocol is not only widely used on the web, but also most APIs use it. This is what we refer to as synchronous API. We actually did not even call them synchronous APIs until the asynchronous APIs (or async APIs) appeared.
So what are async APIs?
Async APIs solve a different need. The communication is no longer following the pattern of sending a request and receiving a response. While this is still possible, most of the time it is event-based.
Async APIs are like when you are exchanging texts with a friend. You don’t know when a reply comes or how many messages you get. It is unpredictable.
With synchronous APIs, you would have to send a request asking for new messages all the time. With asynchronous APIs, you can subscribe to getting new messages. There are use cases then…