Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def test_websocket(aiohttp_client, loop):
- app = web.Application()
- app.router.add_get('/', index)
- client = await aiohttp_client(app)
- headers = {'Authorization': 'Token bG912312n3aasdW46cGFzcw=='}
- resp = await client.ws_connect('/', headers=headers)
- # в сокете вот так вывожу
- pprint(ws_current.headers)
- pprint(ws_current.get('Authorization'))
- # получаю
- """
- <CIMultiDict('Upgrade': 'websocket', 'Connection': 'upgrade', 'Sec-WebSocket-Accept': '+m42KK2222Q9SkaxOLqDCUvu4bo=', 'Content-Type': 'application/octet-stream', 'Date': 'Sat, 22 Feb 2020 07:39:02 GMT', 'Server': 'Python/3.7 aiohttp/3.6.2')>
- None
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement