def req(self, method, path, data):
h = {"Accept": "application/json",
"Content-type": "application/json"}
if self.xsrf:
h[DemistoClient.XSRF_TOKEN_KEY] = self.token
else:
h[DemistoClient.AUTHORIZATION] = self.apiKey
try:
if self.session:
r = self.session.request(method, self.server+path, headers=h, verify=False, json=data)
else:
raise RuntimeError("Session not initialized!")
except InsecureRequestWarning:
pass
return r
评论列表
文章目录