'Returns a dictionary from HTTP header text.
>>> h = HTTPHeaders.parse("Content-Type: text/html\r\nContent-Length: 42\r\n")
>>> sorted(h.items())
[(\'Content-Length\', \'42\'), (\'Content-Type\', \'text/html\')]'

@classmethod
def parse(cls, headers):

    h = cls()
    for line in _CRLF_RE.split(headers):
        if line:
            h.parse_line(line)
    return h
