import requests


def get_headers(url):
	"""
	Takes a url (string) as argument and performs a GET or HEAD request.
	Returns a dictionary with the response headers.
	"""
	ret = {}
	h = requests.head(url)
	if h.status_code == 405:
		h = requests.get(url)
	raw = dict(h.headers)
	for i in raw.keys():
		ret[i.lower().strip()] = raw[i].lower().strip()
	return ret