Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(
self,
host="",
url="/",
method="GET",
headers={},
protocol=PT.HTTP,
content=None,
port=None,
key_file=None,
cert_file=None,
timeout=None):
HttpRequest.__init__(
self,
host=host,
url=url,
method=method,
headers=headers)
self.__ssl_enable = False
if protocol is PT.HTTPS:
self.__ssl_enable = True
self.__key_file = key_file
self.__cert_file = cert_file
from aliyunsdkcore.acs_exception import error_code
import abc
"""
Acs request model.
Created on 6/15/2015
@author: alex jiang
"""
STYLE_RPC = 'RPC'
STYLE_ROA = 'ROA'
STYLE_OSS = 'OSS'
_default_protocol_type = protocol_type.HTTP
def set_default_protocol_type(user_protocol_type):
global _default_protocol_type
if user_protocol_type == protocol_type.HTTP or user_protocol_type == protocol_type.HTTPS:
_default_protocol_type = user_protocol_type
else:
raise exceptions.ClientException(
error_code.SDK_INVALID_PARAMS,
"Invalid 'protocol_type', should be 'http' or 'https'"
)
def get_default_protocol_type():
return _default_protocol_type
def set_default_protocol_type(user_protocol_type):
global _default_protocol_type
if user_protocol_type == protocol_type.HTTP or user_protocol_type == protocol_type.HTTPS:
_default_protocol_type = user_protocol_type
else:
raise exceptions.ClientException(
error_code.SDK_INVALID_PARAMS,
"Invalid 'protocol_type', should be 'http' or 'https'"
)