separate key and url to config file

This commit is contained in:
StevanFreeborn
2022-04-16 23:16:53 -05:00
parent 700e523809
commit 81091b9f43
3 changed files with 26 additions and 2 deletions
+3
View File
@@ -1,3 +1,6 @@
# Config
config.ini
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
-1
View File
@@ -856,4 +856,3 @@ class OnspringClient:
endpoint = GetReportsByAppIdEndpoint(self.baseUrl, appId) endpoint = GetReportsByAppIdEndpoint(self.baseUrl, appId)
return return
+22
View File
@@ -0,0 +1,22 @@
from OnspringClient import OnspringClient
from configparser import ConfigParser
cfg = ConfigParser()
cfg.read('config.ini')
key = cfg['prod']['key']
url = cfg['prod']['url']
onspringClient = OnspringClient(url, key)
response =onspringClient.GetAppById(8)
print(response.statusCode)
print(response.isSuccessful)
print(response.message)
print(response.responseText)
print(response.headers)
print(response.data.app.href)
print(response.data.app.id)
print(response.data.app.name)