Yes, just use the @RequestBody and create a POJO class that contains an attribute of String id. Note that you will not be able to pass the href of the link, so you will have to create a request by forwarding json via Javascript.
For example:
@GetMapping("/pessoa/")
public ModelAndView editaPessoa(@RequestBody PessoaInterface pessoa) {
.....
}
PersonaInterface.java
public class PessoaInterface {
String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
Note that in PersonInterface.java you can add a List and pass through numerous IDs in a single request.
Ideal solution
You are using the GET method to do an edit. One of the principles of REST is to respect HTTPs codes and use the correct verbs, that is, to use GET only in a case where you need to access something . Ideally you should use PUT or PATCH for editing (I can not say which one I'm sure because I do not know your scenario).
Note that it is not only a matter of respecting the standards, there is a long thread about forwarding body in a GET request ( link ) and some servers even refuse by default requests GETs with body. Speaking of REST, this is certainly not supported.
What if you wanted to get an element without having to go through the ID?
Assuming that your problem is not a person edit but a person passing the ID, in these cases we continue to go through path param but GUIDs are used instead of IDs.