HttpWebResponse上的ContentType属性是否有枚举(“文本/纯文本",“应用程序/八位字节流"等)? [英] Is there an enum for the ContentType property on a HttpWebResponse ("text/plain", "application/octet-stream" etc.)?

查看:706
本文介绍了HttpWebResponse上的ContentType属性是否有枚举(“文本/纯文本",“应用程序/八位字节流"等)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能找到的最接近的东西是System.Net.Mime.MediaTypeNames,但这似乎并没有包含所有内容(例如json),因为它似乎更着重于电子邮件附件.

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.

推荐答案

枚举没有多大意义. MIME类型是开放式的.也就是说,列表不是有限的:不时添加新类型.

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.

请参见 RFC4288:媒体类型规范和注册过程

这篇关于HttpWebResponse上的ContentType属性是否有枚举(“文本/纯文本",“应用程序/八位字节流"等)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆