docs: def add_content(self, data):
          # type: (Optional[Union[Dict[str, Any], ET.Element]]) -> None
          """Add a body to the request.
  
          :param data: Request body data, can be a json serializable
           object (e.g. dictionary) or a generator (e.g. file data).
          """
          if data is None:
              return
  
          if isinstance(data, ET.Element):
              bytes_data = ET.tostring(data, encoding="utf8")
              self.headers['Content-Length'] = str(len(bytes_data))
              self.data = bytes_data
              return
  
          # By default, assume JSON
          try:
              self.data = json.dumps(data)
              self.headers['Content-Length'] = str(len(self.data))
          except TypeError:
              self.data = data