@@ -61,6 +61,7 @@ def __init__(self,
6161 cafile : Optional [str ] = None ,
6262 insecure : bool = False ,
6363 ignore_hostname_verification : bool = False ,
64+ user_agent : str = 'Kanboard Python API Client' ,
6465 loop : Optional [asyncio .AbstractEventLoop ] = None ):
6566 """
6667 Constructor
@@ -73,6 +74,7 @@ def __init__(self,
7374 cafile: Path to a custom CA certificate
7475 insecure: Ignore SSL certificate errors and ignore hostname mismatches
7576 ignore_hostname_verification: Ignore SSL certificate hostname verification
77+ user_agent: Use a personalized user agent
7678 loop: An asyncio event loop. Default: asyncio.get_event_loop()
7779 """
7880 self ._url = url
@@ -81,6 +83,7 @@ def __init__(self,
8183 self ._auth_header = auth_header
8284 self ._cafile = cafile
8385 self ._insecure = insecure
86+ self ._user_agent = user_agent
8487 self ._ignore_hostname_verification = ignore_hostname_verification
8588
8689 if not loop :
@@ -174,6 +177,7 @@ def execute(self, method: str, **kwargs):
174177 headers = {
175178 self ._auth_header : auth_header_prefix + credentials .decode (),
176179 'Content-Type' : 'application/json' ,
180+ 'User-Agent' : self ._user_agent ,
177181 }
178182
179183 return self ._do_request (headers , payload )
0 commit comments