webinspect.py 文件源码

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

项目:webinspectapi 作者: target 项目源码 文件源码
def upload_policy(self, policy_file_path):
        try:
            data = {"policy": ""}
            files = {'file': (ntpath.basename(policy_file_path), open(policy_file_path, 'rb'),)}

        except IOError as e:
            return WebInspectResponse(success=False,
                                      message="There was an error while handling the request{}.".format(e))

        # hack. doing this avoids us later specifying a content-type of application/json. needs a refactor
        headers = {
            'Accept': 'application/json'
        }
        return self._request('POST', '/webinspect/securebase/policy', data=data, files=files, headers=headers)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号