client.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:demisto-py 作者: demisto 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号