小编典典

HTTP“Content-Type”标头的所有可能值是什么?

all

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

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

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


阅读 131

收藏
2022-03-31

共1个答案

小编典典

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

最常见的类型是:

  1. 类型应用

    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

  2. 输入音频

    audio/mpeg
    

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

  3. 输入图片

    image/gif
    

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

  4. 键入多部分

    multipart/mixed
    

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

  5. 输入文字

    text/css
    

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

  6. 输入视频

    video/mpeg
    

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

  7. 输入 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

2022-03-31