上一篇

接口测试笔记二

websocket接口调用

websocket.py

from ws4py.client.threadedclient import WebSocketClient

class CG_Client(WebSocketClient):

  def opened(self):
    req = "Hello, World"
    self.send(req)

  def closed(self, code, reason=None):
    print("Closed down:", code, reason)

  def received_message(self, resp):
    result = str(resp)
    print(" 返回 "+result)

if __name__ == '__main__':
  ws = None
  try:
    ws = CG_Client('ws://echo.websocket.org')
    ws.connect()
    ws.run_forever()
  except KeyboardInterrupt:
    ws.close()

接口测试笔记三

 https://gitee.com/babybeibeili/testFrame.git

相关文章:

  • 2021-09-11
  • 2022-12-23
  • 2021-11-07
  • 2021-12-18
  • 2021-09-03
  • 2021-10-06
  • 2021-12-31
  • 2021-10-30
猜你喜欢
  • 2021-08-24
  • 2021-09-02
  • 2021-12-04
  • 2021-07-05
  • 2022-12-23
  • 2021-08-16
相关资源
相似解决方案