I am working on a Spring-MVC application in which for this single method I am getting an error as Unsupported media type
. None of the other methods have this problem. Any help would be nice. Thank you-.
Java Code :
@RequestMapping(value = "/setnotificationlevels")
public
@ResponseBody
boolean setNotificationLevels(@RequestParam("groupid") long groupid, @RequestBody GroupMembers member) {
System.out.println("Set notification levels is called. ");
return this.groupMembersService.setNotificationLevels(member, groupid);
}
JS code :
setEmailNotifications : function (groupid, settings){
return $.ajax({
url: "/setnotificationlevels?groupid=" + groupid,
type: 'POST',
cache:false,
data : JSON.stringify(settings),
contentType: "application/json; charset=utf-8"
});
},
Error log :
description The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.
Thank you.