def __init__(self, host, username=None, password=None, verify_ssl=True, user_agent=None, cert=None):
self.host = host
self.username = username
self.password = password
self.cert = cert
self.verify_ssl = verify_ssl
if not user_agent:
self.user_agent = 'webinspectapi/' + version
else:
self.user_agent = user_agent
if not self.verify_ssl:
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Set auth_type based on what's been provided
if username is not None:
self.auth_type = 'basic'
elif cert is not None:
self.auth_type = 'certificate'
else:
self.auth_type = 'unauthenticated'
评论列表
文章目录