MIME

MIME - Multipurpose Internet Mail Extensions

MIME是用来定义document,file或binary的性质和格式

语法 type/subtype type/subtype;parameter=value

  1. text

    • text/plain - text默认
      • text/plain;charset=UTF-8
    • text/html
    • text/css
    • text/javascript
    • text/markdown
  2. image

    • image/gif
    • image/png
    • image/jpeg
    • image/bmp
    • image/webp
    • image/svg+xml
    • image/x-icon
    • image/vnd.microsoft.icon
  3. audio

    • audio/midi
    • audio/mpeg
    • audio/webm
    • audio/ogg
    • audio/wav
  4. video

    • video/webm
    • video/ogg
  5. application

    • application/octet-stream - binary默认
      • Content-Disposition header 被设置成 attachment, 并且可能会弹出一个保存框。
    • application/pkcs12
    • application/json
    • application/vnd.mspowerpoint
    • application/xhtml+xml
    • application/xml
    • application/pd
  6. multipart
    • multipart/form-data
    • multipart/byteranges
      • 用来发送部分回应给服务器。当206 Partial Content状态码被发送时, multipart/byteranges 表明这个文档有多个部分组成。每个部分都有它自己 Content-Range 和 Content-Type 这2个header。
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
           HTTP/1.1 206 Partial Content
        Accept-Ranges: bytes
        Content-Type: multipart/byteranges; boundary=3d6b6a416f9b5
        Content-Length: 385

        --3d6b6a416f9b5
        Content-Type: text/html
        Content-Range: bytes 100-200/1270

        eta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <meta name="vieport" content
        --3d6b6a416f9b5
        Content-Type: text/html
        Content-Range: bytes 300-400/1270

        -color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: "Open Sans", "Helvetica
        --3d6b6a416f9b5--

参考链接:

  1. https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types
  2. https://www.iana.org/assignments/media-types/media-types.xhtml