From 9144f0158aedf3ac825dcd6ae8a6087450a07b18 Mon Sep 17 00:00:00 2001 From: Taoufik Date: Tue, 25 Dec 2018 01:15:54 +0000 Subject: [PATCH] Websocket docs --- docs/source/tour.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/tour.rst b/docs/source/tour.rst index a331d7d..c50c1c7 100644 --- a/docs/source/tour.rst +++ b/docs/source/tour.rst @@ -184,6 +184,19 @@ If you'd like a view to be executed before every request, simply do the followin Now all requests to your HTTP Service will include an ``X-Pizza`` header. +WebSocket Support +----------------- + +Responder supports WebSockets:: + + @api.route('/ws', websocket=True) + async def ws1(ws): + await ws.accept() + while True: + name = await ws.receive_text() + await ws.send_text(f"Hello {name}!") + await ws.close() + Using Requests Test Client --------------------------