Allow API connection over HTTPS

This commit is contained in:
David Beitey
2019-09-15 11:11:21 +10:00
parent 4ebc0a2c97
commit 1f5944801c
3 changed files with 9 additions and 7 deletions

View File

@@ -17,9 +17,9 @@ class Request:
try:
headers = {'content-type': 'application/json'}
if params is not None:
r = requests.post(url, params=params, json=data, headers=headers)
r = requests.post(url, verify=False, params=params, json=data, headers=headers)
else:
r = requests.post(url, json=data)
r = requests.post(url, verify=False, json=data)
if r.status_code == 200:
return r
else:
@@ -38,7 +38,7 @@ class Request:
:return:
"""
try:
data = requests.get(url=url, params=params, timeout=timeout)
data = requests.get(url=url, verify=False, params=params, timeout=timeout)
return data
except Exception as e:
print("Get Error\n", e)