DEV Community

Sam Parsons
Sam Parsons

Posted on

Stream Team: a case for Swell

If you are reading this, chances are you have used the Postman API tool to help you create a backend for your application or test what kind of data you can get back from an existing endpoint. For these cases, Postman works really great - and some of its competitors also do those things very well - Insomnia, Apigee, Postwoman, just to name a few. But what happens when you want to make an app with bidirectional communication between the clients and servers? Go ahead, try figure out to use WebSockets with Postman. We will wait.

Maybe you have or haven't tried this, but a quick look to this Github issue will reveal you aren't alone drowning in the thirst for a way to test your or somebody else's Websockets API. This is why Swell exists. Swell is not only another RESTful API testing tool, but most importantly, it exists to solve problems of testing streaming APIs. You can effectively develop your own WebSockets backend or mock how your client would interact with an existing one with the use of Swell. Check out the GIF below and keep reading because the story doesn't end there.

WebSockets

So that's great, but what about streaming communications over HTTP? I encourage you to try and hit an SSE endpoint and see what happens with Postman - you'll run into the same problem you did with WebSockets. Once again, you are not alone - many have voiced their opinion about this, leaving a void in the environment. By selecting a small checkbox on Swell, you will have access to a stream of data from an SSE endpoint with a single request. Problem solved.

SSE

Swell has went through a couple iterations recently, and its latest version has great support for the next wave of streaming communications - GraphQL subscriptions. It's 2020 (pretty much) and people use WebSockets to make GraphQL subscriptions and because Swell already had support for WS protocol, adding GQL subscriptions was a no brainer. In the end, if you are testing your client against a GraphQL subscription API built in 2015 over HTTP, try to use Postman, let them know how you feel - but if you want to develop an industry standard subscription backend, use Swell to make sure you are building a robust, error-free environment.

If you are mocking up or testing against a Pokemon or Star Wars REST API, feel free to use Postman, it works great and has a lot of features. But if you want to develop real-time experiences for your users, consider using Swell to fill in the gaps Postman can't. If you have any feature requests - or maybe you found an easter egg - head over to our issues page and let us know. And if you need something right now, pull the lever on a PR.

Thanks,

Swell Team

Top comments (0)