I am trying to understand Spring REST and REST services. I have created a controller for POST request like this:
@RequestMapping(method = RequestMethod.POST, path = "newItem")
public ResponseEntity<Item> createItem(
@RequestParam(value = "name") String name,
@RequestParam(value = "date") String date,
@RequestParam(value = "location") String location) {
Item item = new Item(name, date, location);
//save into database
}
My question is: What if my Item has let's say 15 attributes. Do I need to create @RequestParam for each of it? Or is that another way of doing it? Could you give me some point where to start?