Change the AJAX call, add the headers:
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }
Your general AJAX call should look like this:
$.ajax({ url: '/authentication/editUser', type: "POST", headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' } dataType: "json", data: JSON.stringify(requestObj),
The Content-Type @RequestBody used by @RequestBody to determine the format for sending data.
source share