code: def charset(self) -> Optional[str]:
          
          type_str = cast(str, self.get("Content-Type"))
          if type_str is None or "charset" not in type_str:
              return None
          for i in type_str.split(";"):
              item = i.strip()
              if item.startswith("charset"):
                  return item.split("=")[1].strip()
          return None
docs: 获取 charset