def METHOD_NAME(self, serialized_data: str):
    data = serialized_data
    if self._compression == Compression.Gzip:
        gzip_data = BytesIO()
        with gzip.GzipFile(fileobj=gzip_data, mode="w") as gzip_stream:
            gzip_stream.write(serialized_data)
        data = gzip_data.getvalue()
    elif self._compression == Compression.Deflate:
        data = zlib.compress(bytes(serialized_data))
    return self._session.post(
        url=self._endpoint,
        data=data,
        verify=self._certificate_file,
        timeout=self._timeout,
    )