I am building project REST project with Spring Boot and i come across an issue of sending JSON from client to server.
My Scenerio is i want to send json like this using postman REST client:
{
"test":"success"
}
And want to get this json using this method:
@RequestMapping(value = "/user", method = RequestMethod.POST)
public Map<String, Object> postData(@RequestBody Map map){
log.info("in test Connection method");
return map;
}
I am using above method but it is giving exception.
If it is not possible to process json data with @RequestBody with POST request then is there any other way to get json data with POST request and process that json data?