Method
writeJson
(w http.ResponseWriter, data *ResponseData)
Source from the content-addressed store, hash-verified
| 121 | } |
| 122 | |
| 123 | func (h *HttpServer) writeJson(w http.ResponseWriter, data *ResponseData) { |
| 124 | w.Header().Set("Content-Type", "application/json; charset=utf-8") |
| 125 | w.WriteHeader(200) |
| 126 | err := json.NewEncoder(w).Encode(data) |
| 127 | if err != nil { |
| 128 | globalLogger.Err(err) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func (h *HttpServer) error(w http.ResponseWriter, args ...interface{}) { |
| 133 | message := "ok" |
Tested by
no test coverage detected