1. Background
The project needs to use WebSocket for communication. After developing the WebSocket interface, it must be tested. The following is the method for Postman to call the WebSocket program.
2. Matters needing attention
2.1 Why choose Postman?
Recently, I have been using ApiFox to make interface calls, but the current version of ApiFox (2.2.26) does not support calling WebSocket programs. Well, I can only find another tool that supports calls, and that is the powerful Postman.
2.2 version support
Postman v8.5 and above support websocket, I am using version 10.11.1
When using Postman as a WebSocket program in 2021, it could only be used on the Web side, and the proxy program had to be enabled. Now it can support the desktop side. I lament the iteration speed of Postman!
3. How to call the WebSocket program
3.1 Create a new collection (or directory)
Click the + button in the upper left corner, click the Add Request button for the collection created in this way, it must be HTTP
, so you need to create a new collection. Click the New button in the upper right corner
to select this WebSocket Request
Click ctrl+s to save,
Enter a collection name here.
3.2 New WebSocket request
Create a new request through Add Request+WebSocket.