diff options
| author | ckonstanski <kostcarl@isu.edu> | 2026-07-30 18:17:14 -0600 |
|---|---|---|
| committer | ckonstanski <kostcarl@isu.edu> | 2026-07-30 18:17:14 -0600 |
| commit | 640ff61422bc0ee3966941b93d9889ddbbd38d77 (patch) | |
| tree | abf1c08f5d38ee53ec8b29dc4f425722517505e6 /src/caas/services/httpclient.py | |
| parent | 22dae02a86c1fce71091bfa5289cf99abba1b217 (diff) | |
Diffstat (limited to 'src/caas/services/httpclient.py')
| -rw-r--r-- | src/caas/services/httpclient.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/caas/services/httpclient.py b/src/caas/services/httpclient.py new file mode 100644 index 0000000..ad8270b --- /dev/null +++ b/src/caas/services/httpclient.py @@ -0,0 +1,18 @@ +import requests +from requests.packages.urllib3.exceptions import InsecureRequestWarning +from requests.auth import HTTPBasicAuth + + +class HttpClient(object): + def __init__(self): + requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + self.session = requests.Session() + + def post(self, url, username, password, data = None, headers = {}, timeout = 60): + resp = self.session.post(url = url, + auth = HTTPBasicAuth(username, password), + json = data, + headers = headers, + timeout = timeout, + verify = False) + return resp |
