Content-Type在将标头值传递给 HTTP 请求之前,我必须对其进行验证。
Content-Type
是否有所有可能值的特定列表Content-Type?
否则,有没有办法在 HTTP 请求中使用它之前验证内容类型?
您可以在此处找到每种内容类型: http ://www.iana.org/assignments/media-types/media- types.xhtml
最常见的类型是:
类型应用
application/java-archive
application/EDI-X12 application/EDIFACT application/javascript application/octet-stream application/ogg application/pdf application/xhtml+xml application/x-shockwave-flash application/json application/ld+json application/xml application/zip application/x-www-form-urlencoded
输入音频
audio/mpeg
audio/x-ms-wma audio/vnd.rn-realaudio audio/x-wav
输入图片
image/gif
image/jpeg image/png image/tiff image/vnd.microsoft.icon image/x-icon image/vnd.djvu image/svg+xml
键入多部分
multipart/mixed
multipart/alternative multipart/related (using by MHTML (HTML mail).) multipart/form-data
输入文字
text/css
text/csv text/html text/javascript (obsolete) text/plain text/xml
输入视频
video/mpeg
video/mp4 video/quicktime video/x-ms-wmv video/x-msvideo video/x-flv video/webm
输入 vnd :
application/vnd.android.package-archive
application/vnd.oasis.opendocument.text application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.graphics application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.ms-powerpoint application/vnd.openxmlformats-officedocument.presentationml.presentation application/msword application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.mozilla.xul+xml