Parses a JSON request body, returning it as a Body map.
()
| 1320 | |
| 1321 | // Parses a JSON request body, returning it as a Body map. |
| 1322 | func (h *handler) readJSON() (db.Body, error) { |
| 1323 | var body db.Body |
| 1324 | return body, h.readJSONInto(&body) |
| 1325 | } |
| 1326 | |
| 1327 | // Parses a JSON request body into a custom structure. |
| 1328 | func (h *handler) readJSONInto(into interface{}) error { |
no test coverage detected