how to add headers to websockets (python)

Asked

Viewed 28 times

1

I’m using the lib websockets python, and for me to make the connection (discord.com/api), he asks for a Authorization

import asyncio
import websockets

async def connection_websockets():
    uri = 'wss://discord.com/api/v6'
    async with websockets.connect(uri, ...headers) as ws:
        pass

asyncio.get_event_loop().run_until_complete(connection_websockets())
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.