@RequestMapping(method = RequestMethod.GET)
public List<Pessoa> listar() {
return pessoaRepository.findAll();
}
@RequestMapping (method = RequestMethod.POST)
public String salvar (@RequestBody Pessoa pessoa) {
pessoaRepository.save(pessoa);
return "cadPessoa";
}
/*
* @RequestMapping(value = "/{id}", method = RequestMethod.GET) public Pessoa
* buscar(@PathVariable("id") Long id) { return pessoaRepository.findOne(id);
*
* }
*/
@RequestMapping (value = "/{id}/{nome}/{cpf}", method = RequestMethod.DELETE)
public void deletar (@PathVariable("id") Long id, @PathVariable("nome") String nome, @PathVariable("cpf") int cpf) {
pessoaRepository.deleteById(id);
}
}
LOG:
There was an unexpected error (type=Unsupported Media Type, status=415).
Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported
Content type ‘application/x-www-form-urlencoded;charset=UTF-8