跳到主要内容

6. 与 HTTP Protocol Messages 的显著差异 (Notable Differences with HTTP Protocol Messages)

此格式与 HTTP message encodings 在几个关键方面不同:

  1. 无 HTTP version - binary format 不包含 HTTP version identifier

  2. Field names 小写 - 所有 field names MUST 为小写, 遵循 HTTP/2 约定

  3. 无 transfer encoding - Content 直接编码, 不使用 Transfer-Encoding header

  4. Status code 作为整数 - Response status codes 是 variable-length integers, 不是 strings

  5. 无 reason phrase - Responses 不包含与 status code 一起出现的 reason phrase

  6. Pseudo-headers 作为 control data - HTTP/2-style pseudo-headers 变为 control data fields

  7. Binary encoding - 所有长度和值使用 QUIC variable-length integer encoding

  8. 无 chunked encoding - Indeterminate-length mode 替代 chunked transfer encoding

这些差异在保留 HTTP message semantics 的同时, 支持更高效的编码和处理.