class ApiHandlerHelpers {

    public static String validateContentType(HttpRequest request, String expectedContentType) {
    	LoggingService.logDebug(MODULE_NAME, "Validate content type in request : " + request);
        try {
			final String contentType = request.headers().get(HttpHeaderNames.CONTENT_TYPE, "");
			if (TextUtils.isEmpty(contentType) || !(contentType.trim().split(";")[0].equalsIgnoreCase(expectedContentType))) {
				return "Incorrect content type " + contentType;
			}
		} catch (Exception e) {
			LoggingService.logError(MODULE_NAME, "Error validating content type",
					new AgentUserException(e.getMessage(), e));
			return "Incorrect content type " ;
		}
        return null;
    }

}