Search code examples
content-typemime-typeshttpwebresponse

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


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


Solution

  • An enum doesn't make much sense. MIME types are open-ended. That is, the list is not finite: new types are added from time to time.

    See RFC4288: Media Type Specifications and Registration Procedures