import requests
import traceback


def headers(url, redirect=True):
	"""
	Returns the reply headers as a dict
	:param url: str - url to retrieve the reply headers
	:param redirect: boolean - (optional) should we follow redirects?
	:return: dict
	"""
	try:
		return dict(requests.head(url, allow_redirects=redirect).headers)
	except:
		print(traceback.print_exc())
		pass
		return {}