I'm trying to create a rest post request using Spring but what is been received is a null value.
If I use the first request I get back null values. If I use the second request I receive a 415Unsupported Media Type. Does anyone know where my issue is?
@RequestMapping(value = "/product", method=RequestMethod.POST,produces = "application/json")
@ResponseBody Product addProduct(Product p1) {
System.out.print("Adding product:"+p1.getDescription());
return p1;
}
@RequestMapping(value="/product2", method=RequestMethod.POST, produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Product greeting(@RequestBody Product p1) {
System.out.print("Adding product:"+p1.getDescription());
return p1;
}


