'Parse the headers out of some web content.
@param content: Bytes received from a web server.
@return: A tuple of (requestLine, headers, body). C{headers} is a dict
of headers, C{requestLine} is the first line (e.g. "POST /foo ...")
and C{body} is whatever is left.'

def _parseOutHeaders(self, content):

    (headers, body) = content.split('\r\n\r\n')
    headers = headers.split('\r\n')
    requestLine = headers.pop(0)
    return (requestLine, dict((header.split(':    ') for header in headers)), body)
