From e50b97f8d1e17cc427c8ff7d0fed468fa475c1f7 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Wed, 12 Oct 2022 10:02:53 -0700 Subject: [PATCH] Add user agent Following the same format as the JS SDK. --- seamapi/seam.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seamapi/seam.py b/seamapi/seam.py index f84a3d3..76103e1 100644 --- a/seamapi/seam.py +++ b/seamapi/seam.py @@ -1,6 +1,7 @@ import os from .routes import Routes import requests +import pkg_resources from typing import Optional, cast from .types import AbstractSeam, SeamAPIException @@ -82,6 +83,7 @@ def make_request(self, method: str, path: str, **kwargs): headers = { "Authorization": "Bearer " + self.api_key, "Content-Type": "application/json", + "User-Agent": "Python SDK v" + pkg_resources.get_distribution("seamapi").version + " (https://github.com/seamapi/python)", } response = requests.request(method, url, headers=headers, **kwargs)