是否存在HTTP2请求/响应对应的语言语法规范?
Great question! You’re right to seek out an equivalent specification to HTTP 1.1’s 1999 RFC 2616 for HTTP/2—here’s a clear breakdown:
核心规范:RFC 7540
HTTP/2’s official, comprehensive specification is RFC 7540, released in May 2015. Unlike HTTP 1.1’s text-based syntax, HTTP/2 operates on a binary framing layer, so its "grammar" centers around structured binary frames rather than human-readable plaintext lines. This RFC covers all critical details for HTTP/2 requests and responses, including:
- The binary frame format that wraps request/response metadata and payloads
- How familiar HTTP concepts (methods, status codes, headers) are adapted to the binary protocol
- Rules for multiplexing multiple requests/responses over a single connection
- Header compression mechanics via HPACK (defined alongside in RFC 7541)
关于 HTTP 1.1 的快速补充
As a quick side note: The 1999 RFC 2616 you referenced has been officially obsoleted. The modern HTTP 1.1 specification is split across RFCs 7230–7235, which clarify and update the original standard. But that’s a tangent—back to your main question!
关键语法差异 vs HTTP 1.1
Since HTTP/2 uses binary framing, its syntax looks very different from HTTP 1.1’s plaintext structure:
- Requests and responses are split into distinct frame types (e.g.,
HEADERSframes for request/response metadata,DATAframes for content payloads) - Headers are compressed to minimize overhead, so they aren’t sent as raw text strings
- Multiple requests and responses can be processed concurrently over a single TCP connection, thanks to multiplexing
内容的提问来源于stack exchange,提问作者Lance Pollard

