Parse raw HTTP Headers
Update: It’s 2019, so I have rewritten this answer for Python 3, following a confused comment from a programmer trying to use the code. The original Python 2 code is now down at the bottom of the answer. There are excellent tools in the Standard Library both for parsing RFC 821 headers, and also for parsing … Read more