phpIPAM.py 文件源码

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

项目:phpIPAM 作者: michaelluich 项目源码 文件源码
def authorization(self,controller):
        headers = {'token': self.token}
        p = requests.options(self.base+"%s/" %(controller), headers=headers)
        auth_json = json.loads(p.text)

        if p.status_code != 200:
            logging.error("phpipam.authorization: Failure %s" %(p.status_code))
            logging.error(auth_json)
            self.error = p.status_code
            self.error_message=auth_json['message']
            return self.error,self.error_message

        if not auth_json['success']:
            logging.error("phpipam.authorization: FAILURE: %s" %(auth_json['code']))
            self.error=auth_json['code']
            return self.error

        logging.info("phpipam.authorization: success %s" %(auth_json['success']))
        return auth_json['data']['methods']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号