Commit 8d42b2f4 authored by Verdan Mahmood's avatar Verdan Mahmood Committed by Tamika Tannis

Adds the header in case of requests client APIs (#148)

parent bdb50e39
......@@ -85,12 +85,12 @@ def request_wrapper(method: str, url: str, client, headers, timeout_sec: int):
else:
with requests.Session() as s:
if method == 'DELETE':
return s.delete(url, timeout=timeout_sec)
return s.delete(url, headers=headers, timeout=timeout_sec)
elif method == 'GET':
return s.get(url, timeout=timeout_sec)
return s.get(url, headers=headers, timeout=timeout_sec)
elif method == 'POST':
return s.post(url, timeout=timeout_sec)
return s.post(url, headers=headers, timeout=timeout_sec)
elif method == 'PUT':
return s.put(url, timeout=timeout_sec)
return s.put(url, headers=headers, timeout=timeout_sec)
else:
raise Exception('Method not allowed: {}'.format(method))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment