I am having trouble figuring out how to parse a http header into a map<string,stri ng>
My idea was to find the first index of ':' on each line and use the text before that as the key. Then use everything before the \r\n as the value. The problem is the spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html) says that the values can span multiple lines. Any ideas on how I would handle those? Can the value include a colon (the specs don't seem to specify)?
Code:
POST /blah HTTP/1.1 Host: example.com Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Content-Type: application/x-www-form-urlencoded Content-Length: 25
Comment