HTTP“Content-Type"的所有可能值是什么?头? [英] What are all the possible values for HTTP "Content-Type" header?

查看:35
本文介绍了HTTP“Content-Type"的所有可能值是什么?头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将 Content-Type 标头值传递给 HTTP 请求之前,我必须对其进行验证.

I have to validate the Content-Type header value before passing it to an HTTP request.

是否有针对 Content-Type 的所有可能值的特定列表?

Is there a specific list for all the possible values of Content-Type?

否则,有没有办法在 HTTP 请求中使用内容类型之前对其进行验证?

Otherwise, is there a way to validate the content type before using it in an HTTP request?

推荐答案

您可以在此处找到所有内容类型:http://www.iana.org/assignments/media-types/media-types.xhtml

You can find every content type here: http://www.iana.org/assignments/media-types/media-types.xhtml

最常见的类型是:

  1. 输入应用

  1. Type application

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  

  • 输入音频

  • Type audio

    audio/mpeg   
    audio/x-ms-wma   
    audio/vnd.rn-realaudio   
    audio/x-wav   
    

  • 输入图片

  • Type image

    image/gif   
    image/jpeg   
    image/png   
    image/tiff    
    image/vnd.microsoft.icon    
    image/x-icon   
    image/vnd.djvu   
    image/svg+xml    
    

  • 输入多部分

  • Type multipart

    multipart/mixed    
    multipart/alternative   
    multipart/related (using by MHTML (HTML mail).)  
    multipart/form-data  
    

  • 输入文字

  • Type text

    text/css    
    text/csv    
    text/html    
    text/javascript (obsolete)    
    text/plain    
    text/xml    
    

  • 输入视频

  • Type video

    video/mpeg    
    video/mp4    
    video/quicktime    
    video/x-ms-wmv    
    video/x-msvideo    
    video/x-flv   
    video/webm   
    

  • 输入 vnd :

  • Type 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   
    

  • 这篇关于HTTP“Content-Type"的所有可能值是什么?头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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