rest - How to send json using @RequestBody without using domain object -


i building project rest project spring boot , come across issue of sending json client server. scenerio want send json using postman rest client:

{ "test":"success" } 

and want json using method:

@requestmapping(value = "/user", method = requestmethod.post)     public map<string, object> postdata(@requestbody map map){         log.info("in test connection method");         return map;     } 

i using above method giving exception.

if not possible process json data @requestbody post request there other way json data post request , process json data?

i have tested here , works fine.

you have specify content-type header in post request though, , set application/json. can in postman in headers tab.`

without internal server error (500) saying

content type 'text/plain;charset=utf-8' not supported


Comments