I've done perfectly adequate HTTP parsing with this Python 4-liner:
headerText, body = text.split('\r\n\r\n', 1)
headerLines = headerText.split('\r\n')
method, path, protocol = headerLines[1].split(' ')
headers = dict(line.split(':').map(str.strip) for line in lines[1:])
For production use you'd probably want something a bit faster & more robust like Mongrel's HTTP parser (itself only 166 lines of Ragel), which powers several million websites out there:
https://github.com/mongrel/mongrel/blob/master/ext/http11/ht...