0

I am inquiring about Brandon Rhodes' solution to the problem "Parse raw HTTP headers" in the question Parse raw HTTP Headers. This has brought another question of mine. Is there anyway to use his solution, but maintain the ordering of the HTTP fields?

In his solution, fields are keys in a dictionary. However, the loss of information inherent in this model is the order of the HTTP fields, which I require.

Community
  • 1
  • 1
jeffrey
  • 3,196
  • 7
  • 26
  • 44
  • If you want to get a reliable order you should not use dict, use a list solution instead. – Alexander Starostin Nov 16 '14 at 23:11
  • I would just get the first word of each line of the header (space delimited for the request line, and colon delimited for the rest), but I think RFC allows fields to span multiple lines. – jeffrey Nov 16 '14 at 23:12

0 Answers0