Skip to content

Commit 1fe513a

Browse files
committed
feat: set custom User-Agent in API requests
1 parent 5697506 commit 1fe513a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lettermint/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
import platform
6+
from importlib.metadata import version
57
from typing import Any
68

79
import httpx
@@ -41,6 +43,7 @@ def __init__(
4143
headers={
4244
"Content-Type": "application/json",
4345
"Accept": "application/json",
46+
"User-Agent": f"Lettermint/{version('lettermint')} (Python; python {platform.python_version()})",
4447
"x-lettermint-token": self._api_token,
4548
},
4649
)
@@ -218,6 +221,7 @@ def __init__(
218221
headers={
219222
"Content-Type": "application/json",
220223
"Accept": "application/json",
224+
"User-Agent": f"Lettermint/{version('lettermint')} (Python; python {platform.python_version()})",
221225
"x-lettermint-token": self._api_token,
222226
},
223227
)

0 commit comments

Comments
 (0)