跳到主要内容

10. 将消息封装为数据

10.1. 媒体类型 message/http

"message/http" 媒体类型可用于封装单个 HTTP 请求或响应消息, 前提是它遵守所有 "message" 类型关于行长度和编码的 MIME 限制. 由于行长度限制, "message/http" 内的字段值允许使用第 5.2 节所述的行折叠 (obs-fold), 以在多行上传达字段值. "message/http" 数据的接收方在使用该消息时, MUST 将任何过时行折叠替换为一个或多个 SP 字符.

Type name: message

Subtype name: http

Required parameters: N/A

Optional parameters: version, msgtype

  • version: 被封装消息的 HTTP-version 编号 (例如 "1.1"). 如果不存在, 可从主体的第一行确定版本.
  • msgtype: 消息类型 -- "request" 或 "response". 如果不存在, 可从主体的第一行确定类型.

Encoding considerations: 只允许 "7bit", "8bit" 或 "binary"

Security considerations: 见第 11 节

Interoperability considerations: N/A

Published specification: RFC 9112 (见第 10.1 节)

Applications that use this media type: N/A

Fragment identifier considerations: N/A

Additional information:

  • Magic number(s): N/A
  • Deprecated alias names for this type: N/A
  • File extension(s): N/A
  • Macintosh file type code(s): N/A

Person and email address to contact for further information: 见 Authors' Addresses 节

Intended usage: COMMON

Restrictions on usage: N/A

Author: 见 Authors' Addresses 节

Change controller: IESG

10.2. 媒体类型 application/http

"application/http" 媒体类型可用于封装由一个或多个 HTTP 请求消息或响应消息组成的流水线 (不得混合请求和响应).

Type name: application

Subtype name: http

Required parameters: N/A

Optional parameters: version, msgtype

  • version: 被封装消息的 HTTP-version 编号 (例如 "1.1"). 如果不存在, 可从主体的第一行确定版本.
  • msgtype: 消息类型 -- "request" 或 "response". 如果不存在, 可从主体的第一行确定类型.

Encoding considerations: 此类型封装的 HTTP 消息采用 "binary" 格式; 通过电子邮件传输时, 需要使用适当的 Content-Transfer-Encoding.

Security considerations: 见第 11 节

Interoperability considerations: N/A

Published specification: RFC 9112 (见第 10.2 节)

Applications that use this media type: N/A

Fragment identifier considerations: N/A

Additional information:

  • Deprecated alias names for this type: N/A
  • Magic number(s): N/A
  • File extension(s): N/A
  • Macintosh file type code(s): N/A

Person and email address to contact for further information: 见 Authors' Addresses 节

Intended usage: COMMON

Restrictions on usage: N/A

Author: 见 Authors' Addresses 节

Change controller: IESG