def content_length(self) -> Optional[int]:
        """The value of Content-Length HTTP header."""
        content_length = self._headers.get(  # type: ignore[attr-defined]
            hdrs.CONTENT_LENGTH
        )

        if content_length is not None:
            return int(content_length)
        else:
            return None
The value of Content-Length HTTP header.
lib/aiohttp/helpers.py