We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1033fd commit 10cc5cbCopy full SHA for 10cc5cb
openrouteservice/utility.py
@@ -1,12 +1,17 @@
1
from openrouteservice.configuration import Configuration
2
from openrouteservice.api_client import ApiClient
3
4
-def apiClient(apiKey: str, host: str = None) -> ApiClient:
+def apiClient(apiKey: str = None, host: str = None) -> ApiClient:
5
configuration = Configuration()
6
- configuration.api_key['Authorization'] = apiKey
+
7
+ if(apiKey):
8
+ configuration.api_key['Authorization'] = apiKey
9
10
if(host):
11
configuration.host = host
12
13
+ if not(host or apiKey):
14
+ raise ValueError('apiKey is required when using api.openrouteservice.org as a host. Please specify an apiKey or use a different host.')
15
16
return ApiClient(configuration)
17
0 commit comments