I am trying to identify the data format of retrieving data in a REST end point. I planning to only give response for request that having JSON data format when API is calling. From the retrieved header I am planning to identify that.
I am defining the end point is like following structure:
@PostMapping("/login/checkAuthorization")
public PrivillegeResponse checkAuthorizationAction(@RequestBody
PrivillegeModel privillegeObj )
{
//codes to be executed
//giving JSON response
}
Before giving its business logic implementation , I need to verify that the data retrieved is JSON data. What are the possibilities to achieve these functionalities?