}
@RequestMapping(method = RequestMethod.POST, headers = "Accept=application/json")
public ResponseEntity<String> createFromJson(@RequestBody String json,Authentication authentication) {
Todo todo = Todo.fromJsonToTodo(json);
User user=(User) authentication.getPrincipal();
Userinfo userinfo=userService.findByUserName(user.getUsername()).get(0);
todo.setUserName(userinfo);
todoService.saveTodo(todo);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
return new ResponseEntity<String>(headers, HttpStatus.CREATED);