input: Write a function to read the contents from a given URL and return the content as a string if the request is successful. If the request fails, return None. The function should use the requests library to perform the HTTP GET request.
  
  
  import requests
  
  def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None
  
  assert read_url('https://example.com') is not None
  assert read_url('http://thisisnotawebsite.com') is None
  assert read_url('https://nonexistentdomain123456.com') is None
  assert read_url('https://example.com/nonexistentpage') is None
  assert read_url('https://example.com') == requests.get('https://example.com').text
  
output: import requests
  
  def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None