JSON writes the json-encoded value to the response with the provides status.
(w http.ResponseWriter, code int, v interface{})
| 50 | // JSON writes the json-encoded value to the response |
| 51 | // with the provides status. |
| 52 | func JSON(w http.ResponseWriter, code int, v interface{}) { |
| 53 | setCommonHeaders(w) |
| 54 | w.WriteHeader(code) |
| 55 | writeJSON(w, v) |
| 56 | } |
| 57 | |
| 58 | // Reader reads the content from the provided reader and writes it as is to the response body. |
| 59 | // NOTE: If no content-type header is added beforehand, the content-type will be deduced |
searching dependent graphs…