'get header dict http request'

def get_http_headers(self, http_payload):

    try:
        headers_raw = http_payload[:(http_payload.index('\r\n\r\n') + 2)]
        headers = dict(findall('(?P<name>.*?):(?P<value>.*?)\\r\\n', headers_raw))
    except:
        return None
    if ('Content-Type' not in headers):
        return None
    return headers
