Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_content(self, content, encoding, format):
tmp = dict()
if content is None:
self.__headers.pop(self.content_md5)
self.__headers.pop(self.content_length)
self.__headers.pop(self.content_type)
self.__content_type = None
self.__content = None
self.__encoding = None
return
str_md5 = self.md5_sum(content)
content_length = len(content)
content_type = format_type.RAW
if format is not None:
content_type = format
self.__headers[self.content_md5] = str_md5
self.__headers[self.content_length] = content_length
self.__headers[self.content_type] = content_type
self.__content = content
self.__encoding = encoding
:param bucket: String
:param method: String
:param headers: Dict
:param uri_pattern: String
:param path_params: Dict
:param protocol: String
:return:
"""
AcsRequest.__init__(
self,
product,
version,
action_name,
location_service_code,
'openAPI',
ft.XML,
protocol,
method)
self.__style = STYLE_OSS
self.__bucket = bucket
self.__method = method
self.__header = headers
self.__uri_pattern = uri_pattern
self.__path_params = path_params
:param action_name: String, mandatory
:param method: String
:param headers: Dict
:param uri_pattern: String
:param path_params: Dict
:param protocol: String
:return:
"""
AcsRequest.__init__(
self,
product,
version,
action_name,
location_service_code,
location_endpoint_type,
ft.RAW,
protocol,
method)
self._style = STYLE_ROA
self._method = method
if headers:
self._header = headers
self._uri_pattern = uri_pattern
self._path_params = path_params