(req *http.Request)
| 157 | } |
| 158 | |
| 159 | func getFormat(req *http.Request) string { |
| 160 | const viewFormat = "format" |
| 161 | |
| 162 | format := "" |
| 163 | if len(req.Form[viewFormat]) > 0 { |
| 164 | format = req.Form[viewFormat][0] |
| 165 | } |
| 166 | return format |
| 167 | } |
| 168 | |
| 169 | func viewMessage(w http.ResponseWriter, kv *KV, msg Message, format string) { |
| 170 | c := kv.GetCodec(msg.Pair.Codec) |