I have a JSON file that I want to upload to Server through a Multipart request. In this process, I need to determine the MIME type of the file. I have used the following method to determine the MIME type:
MimeTypeMap.getSingleton().getMimeTypeFromExtension(
fileExtension.toLowerCase());
For an extension of ".json", it returns a null, i.e, json is not registered with any application type.
How can I get the MIME type of a JSON file? Above API is in the most upvoted answer on another SO post to get the MIME type of a file. Is there any API to obtain the same correctly?