Anyone know of a way to preserve the order of response headers received using the net/http package?
As it is, the headers are accessible only as a map[string]string
and iterating over them does not preserve order.
Any input would be much appreciated, thanks all!
map
in go doesn't preserve order by it's nature. – Gennet/http
or just hack that one to go after your ordering wild chase... – MierIf you want the raw headers, you'll need to write some wrapper for net.Conn which captures the raw header before it is interpreted by the http library.
You can access raw headers with a custom wrapper and parse them in original order. – Wreath