Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
url = self.build_url(path)
headers = self.build_headers(headers)
print(data)
try:
resp = requests.request(
method,
url,
headers=headers,
params=params,
data=data,
timeout=self.timeout,
verify=True
)
except Exception:
raise HttpError()
self.handle_api_error(resp)
return resp.json() # FIXME: this is only safe if ApiError has already run .json()
def __init__(self, message=''):
super(HttpError, self).__init__(message or self.message)