I am trying to create a secure REST endpoint to save (and return) a person object. So far I have a method as shown below:
@RequestMapping(value = "/save/", method = RequestMethod.POST)
public Person save(@RequestBody Person person) {
return repository.save(person);
}
I am trying to use Postman to validate this endpoint, but it seems unable to structure the URL correctly. I have to say that I have successfully tested find (Long id) (/ find / {id}) and findall.
http://localhost:8080/api/save?person={"id":2,"first":"Brian","last":"Smith"}
Firstly, is this the right way to structure the endpoint to save the object and the correct Postman structure?
source
share