input: from typing import Optional
  
  def read_url(url: str) -> Optional[str]:
      """ Reads the content from a given URL and returns its text. Returns None if the request fails.
      >>> read_url("https://example.com")
      'Example Domain\n...'
      >>> read_url("https://nonexistenturl.xyz")
      None
      """
output:     import requests
      try:
          response = requests.get(url)
          response.raise_for_status()
          return response.text
      except requests.RequestException:
          return None