Try to get HttpServletRequest and look for the content type.
HttpServletRequest httpReq =null;
try {
httpReq = (HttpServletRequest) PolicyContext.getContext(
"javax.servlet.http.HttpServletRequest");
}
catch(Exception e) {
e.printStackTrace(System.
out);
}