// GetAll updates a thing using it's identifier, with the JSON payload containing name and type func (lr *ThingRouter) PutThing(params martini.Params, r *http.Request, w http.ResponseWriter, thingModel *models.ThingModel, conn redis.Conn) { var thing *model.Thing err := json.NewDecoder(r.Body).Decode(&thing) if err != nil { WriteServerErrorResponse("Unable to parse body", http.StatusInternalServerError, w) return } err = thingModel.Update(params["id"], thing, conn) if err != nil { WriteServerErrorResponse("Unable to update thing", http.StatusInternalServerError, w) return } w.WriteHeader(http.StatusOK) }