Is there an enumeration for the ContentType property in HttpWebResponse ("text / plain", "application / octet-stream", etc.)?

The closest I could find was System.Net.Mime.MediaTypeNames , but it doesn't seem to have everything (like json), as it seems to be more focused on email attachments.

+43
content-type mime-types
Jun 19 '09 at 0:35
source share
2 answers

Enumeration does not make much sense. MIME types are public. That is, the list is not finite: new types are added from time to time.

See RFC4288: Media Type Specifications and Registration Procedures

+20
Jun 19 '09 at 0:43
source

The IANA database is likely to be complete, but you will need to analyze these pages to get a flat list.

There is also a mime.types file that ships with Apache, which appears to have been obtained from the specified list.

+3
Jun 19 '09 at 0:42
source



All Articles