Websocket connections with postman

前端 未结 10 647
星月不相逢
星月不相逢 2020-12-24 04:10

I\'m using Postman to test an existing REST API. This API calls async functions on the server which return a response over a websocket using StompJS.

Is it possible

相关标签:
10条回答
  • 2020-12-24 04:55

    This is not possible as of May 2017, because Postman only works with HTTP methods such as POST, GET, PUT, DELETE.

    P/S: There is a request for this if you want to upvote: github.com/postmanlabs/postman-app-support/issues/4009

    0 讨论(0)
  • 2020-12-24 04:56

    Postman doesn't support websocket. Most of the extension and app I had ever seen were not working properly.

    Solution which I found

    Just login/ open your application in your browser, and open browser console. Then enter your socket event, and press enter.

    socket.emit("event_name", {"id":"123"}, (res)=>{console.log(res); });
    

    0 讨论(0)
  • 2020-12-24 04:57

    As the previous comment mentioned you can't do this in Postman. however, I found this Chrome app in the web store. It is very simple, but it's working really well with my local web socket connections.

    Smart Websocket Client

    0 讨论(0)
  • 2020-12-24 05:00

    You can use the tool APIC available here https://chrome.google.com/webstore/detail/apic-complete-api-solutio/ggnhohnkfcpcanfekomdkjffnfcjnjam. This tool allows you to test websocket which use either StompJS or native Websocket. More info here at www.apic.app

    0 讨论(0)
提交回复
热议问题