I want to know if there exists any way to identify with the Play Framework (with Java language not Scala) if the request is coming from JSON or HTML.
I find a method that is:
If (request().accepts(MimeType.HTML)){
//code
} else{
//code
}
The only way that this works is that the JSON only accepts application/json if not will accept first if clause.
Want I want is that Play identify the Content-Type and not the Accept header.
if ( "application/json".equals(request().getHeader("Content-Type")) ){}? - Salem