// curl -X PUT -i http://localhost:8080/todo-app/api/todo/{id} -d // '{"text":"TODO Item Text","done":true}' @RequestMapping(value = "todo/{id}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.NO_CONTENT) public void update(@PathVariable String id, @RequestBody Todo todo) { Todo existing = todoService.get(id); if (existing == null) throw new NotFoundException(); existing.setText(todo.getText()); existing.setDone(todo.isDone()); }