diff --git a/api-client/client.py b/api-client/client.py index 7b771ca..a2f0c0b 100644 --- a/api-client/client.py +++ b/api-client/client.py @@ -4,7 +4,7 @@ from requests import RequestException from requests_oauthlib import OAuth2Session -def api_client(call_dict): +def api_client(call_dict, verify_cert=False): url = call_dict["url"] headers = call_dict["headers"] @@ -15,15 +15,15 @@ def api_client(call_dict): try: if method == 'GET': - response = client.get(url, headers=headers, params=body, verify=False) + response = client.get(url, headers=headers, params=body, verify=verify_cert) elif method == 'POST': - response = client.post(url, headers=headers, json=body, verify=False) + response = client.post(url, headers=headers, json=body, verify=verify_cert) elif method == 'PUT': - response = client.put(url, headers=headers, json=body, verify=False) + response = client.put(url, headers=headers, json=body, verify=verify_cert) elif method == 'OPTIONS': - response = client.options(url, headers=headers, json=body, verify=False) + response = client.options(url, headers=headers, json=body, verify=verify_cert) elif method == 'DELETE': - response = client.delete(url, verify=False) + response = client.delete(url, verify=verify_cert) else: raise ValueError(f"Invalid method: {method}")