From 9d7cafb48c9934e9b005dd31226567c3e7521967 Mon Sep 17 00:00:00 2001 From: Esteban1313 Date: Sun, 18 Jan 2026 19:33:45 +0100 Subject: [PATCH] Add User-Agent header to API requests Adds a default User-Agent header for better request identification. --- clients.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clients.py b/clients.py index ee0ba2da..09b4f5a2 100644 --- a/clients.py +++ b/clients.py @@ -14,6 +14,9 @@ import websockets +headers["User-Agent"] = "kalshi-python-starter-client" + + class Environment(Enum): DEMO = "demo" PROD = "prod" @@ -231,4 +234,4 @@ async def on_error(self, error): async def on_close(self, close_status_code, close_msg): """Callback when WebSocket connection is closed.""" - print("WebSocket connection closed with code:", close_status_code, "and message:", close_msg) \ No newline at end of file + print("WebSocket connection closed with code:", close_status_code, "and message:", close_msg)