code: def update_content_encoding(self, data: Any) -> None:
          
          if not data:
              return
  
          enc = self.headers.get(hdrs.CONTENT_ENCODING, '').lower()
          if enc:
              if self.compress:
                  raise ValueError(
                      'compress can not be set '
                      'if Content-Encoding header is set')
          elif self.compress:
              if not isinstance(self.compress, str):
                  self.compress = 'deflate'
              self.headers[hdrs.CONTENT_ENCODING] = self.compress
              self.chunked = True
docs: Set request content encoding.