I am new to spring development and want to know what is the difference between
MediaType.APPLICATION_JSON_VALUE
and MediaType.APPLICATION_JSON
?
I have a thought of both are representing same application/json
content type but if I put MediaType.APPLICATION_JSON
some compiler errors are shown to add @controller
and @ResponseBody
annotations to my rest controller and When to use MediaType.APPLICATION_JSON
?
@RequestMapping(value="/invite", method = POST, consumes = { MediaType.APPLICATION_JSON })
public @ResponseBody String sendInvite( ... ) { ... }