code: def get_headers(server):
      
      try:
          response = requests.head(
              server, allow_redirects=False, verify=False, timeout=5)
      except requests.exceptions.ConnectionError:
          return False
  
      return dict(response.headers)
docs: Retrieve all HTTP headers