If so, how can I do that?
I'm trying to write a method that takes a content-type and returns whether it is a JSON file or not.
If so, how can I do that?
I'm trying to write a method that takes a content-type and returns whether it is a JSON file or not.
Here is a function which takes in a content-type string from an HTTP request and returns TRUE if the content-type was a JSON type or FALSE if it wasn't.
public static boolean isJsonContentType(String contentType) {
return (contentType.equals("application/json"));
}