separate key and url to config file
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
# Config
|
||||||
|
config.ini
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|||||||
@@ -856,4 +856,3 @@ class OnspringClient:
|
|||||||
endpoint = GetReportsByAppIdEndpoint(self.baseUrl, appId)
|
endpoint = GetReportsByAppIdEndpoint(self.baseUrl, appId)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
Reference in New Issue
Block a user